Retrieving id of inserted record: What to use @@IDENTITY or SCOPE_IDENTITY() or OUTPUT
Hi guys, This seems very basic information but need to know properly. Issue: I need to find out or have the id of the records which I inserted in table. Analysis: This requirement seems very simple but there could be various cases where you would not get the correct id just by using @@IDENTITY function. Think [...]
February 6, 2013
·
Khilitchandra Prajapati ·
No Comments
Tags: Business Intelligence, General, IDENTITY, Interview Tips, OUTPUT, SCOPE_IDENTITY(), SQL Server · Posted in: Business Intelligence, Free, General, Interview QA, Quick Fix, Quick Tips, Script, SQL Server, SQL Server 2012, SQLServerPedia, T-SQL, Training, Tutorial
The Story of Precision, Scale, and Length in SQL Server
Hi guys, Did you ever faced issues with BIG mathematical figures – related to either overflow or any other arithmetic errors. This may be applicable to SQL arithmetic operations or arithmetic operations you do with SQL table in SSIS etc. Well, check 1 more time, if you have any issues in your database design related [...]
January 28, 2013
·
Khilitchandra Prajapati ·
No Comments
Tags: Arithmetic Overflow, Business Intelligence, Error, General, SQL Server, SSIS · Posted in: Business Intelligence, Free, General, Interview QA, Quick Fix, Quick Tips, Script, SQL Server, SQL Server 2012, SQLServerPedia, SSAS, SSIS, SSRS, T-SQL, Tutorial
Adding a new column to an existing table??? Check the rules first
Hi All, So, you are standing at the gates where you need to add a new COLUMN to an existing table. Well, there are 2 cases: Table is empty Table contains data If “Table is empty” then you are still in design-phase of that table. Add new column whichever the way you know E.g. Using [...]
May 9, 2012
·
Khilitchandra Prajapati ·
3 Comments
Tags: General, Interview Question, Quick Tips, SQL Server, T-SQL · Posted in: General, Interview QA, Quick Tips, SQL Server, Tutorial
Search Country & Location Information based on IP Address
Hi All, Once I ran into the situation where I have to find out the CityCountry name & location (Longitude, Longitude) based on the IP address. This was not difficult but rather not straight-forward as IP addresses are stored into database table as strings which is very obvious because there are no standard data type [...]
February 22, 2012
·
Khilitchandra Prajapati ·
2 Comments
Tags: General, SQL Server · Posted in: General, SQL Server, Tutorial
“Specify Values for Template Parameters” in SQL Server
Hi All, SQL Server Management Studio provides a dialog box named “Specify Values for Template Parameters” for filling values for the template you have used. This is very handy if you always like interface based interactions with components. E.g. When you choose any template from Template Explorer, you will see template with lots of place-holders [...]
February 21, 2012
·
Khilitchandra Prajapati ·
No Comments
Tags: General, SQL Server · Posted in: General, Quick Tips, SQL Server, T-SQL
FileTables in SQL Server 2012
Hi All, FileTables feature introduced in SQL Server 2012. This feature is built on the top of FileStream feature of SQL Server 2012. I published the introduction of FileStream in my previous post. FileTables allows us to store files and documents in special tables in SQL Server called FileTables, but access them from Windows applications [...]
February 19, 2012
·
Khilitchandra Prajapati ·
No Comments
Tags: FileTables, General, SQL Server · Posted in: File Tables, General, SQL Server
Analyzing DEFAULT schema & assigned Role for a Database
Hi All, Following SQL query will list available roles in database and the default schema they are assigned to. You can also check when it’s last modified. –Query Start Use <Your Database Name> Go
February 14, 2012
·
Khilitchandra Prajapati ·
One Comment
Tags: General, SQL Server, Tutorial · Posted in: General, SQL Server, Tutorial
Welcome Microsoft Help Viewer 1.1
Hi All, With the installation of SQL Server 2012 RC0, you will also find integrated “Help Viewer 1.1“. This is pretty much like MSDN help. You can launch the Help viewer by following method.
February 13, 2012
·
Khilitchandra Prajapati ·
No Comments
Tags: General, SQL Server 2012, Tutorial · Posted in: New Features, SQL Server, Tutorial
Auto Generate (Some particular)Change Scripts in SSMS
Hi All, How are you doing? We all know that Change is a rule of life …. And pretty much that applied to SQL Server as well Yes, my point is to find out the changes we have done in current SQL Server so we can deliver into the next environment i.e. UAT/Test or Production [...]
February 12, 2012
·
Khilitchandra Prajapati ·
No Comments
Tags: General, SQL Server 2012 · Posted in: General, New Features, SQL Server, Tutorial
Create SQL scripts quickly using Template Browser – SQL Server 2012 RC0
Hi All, You can quickly create SQL scripts for SQL Server or Analysis Server using Template Browser. It does not cover all detailed scenarios, But it does cover all basic scenarios + you don’t have to worry about the script structure or any deprecated syntaxes etc.
February 12, 2012
·
Khilitchandra Prajapati ·
No Comments
Tags: General, SQL Server 2012 · Posted in: General, New Features, SQL Server, Tutorial
