Category Archives: SQL Server

@@Identity vs ScopeIdentity vs Ident_Current

In this article, we will discuss about concept of @@Identity, Scope_Identity() & Ident_Current(‘Table_Name’) in SQL. All these are helpful in getting the last identity generated in a table. But before we start, we will discuss 2 points, that will  act as a … Continue reading

Posted in SQL Server | Leave a comment

OUTPUT clause in SQL Server

In my previous article, we discussed about the concept of Inserted & Deleted tables in SQL Server. Moving on the same lines, we will now discuss about the concept of OUTPUT keyword. The basic advantage of this keyword is that it … Continue reading

Posted in SQL Server | Leave a comment

Inserted and Deleted tables in SQL

In this article, we will discuss about the concept of Inserted and Deleted tables in SQL. Let’s start with their brief description. As per MSDN: DML trigger statements use two special tables: the deleted table and the inserted tables. SQL Server … Continue reading

Posted in SQL Server | Tagged | Leave a comment

Apply in SQL Server

The apply keyword was introduced mainly for the use of selecting data by combining a select query with a table valued function, which is nothing but select query on another table (or result of any business logic in the function). To understand it … Continue reading

Posted in SQL Server | Tagged | Leave a comment

Coalesce in SQL Server

Coalesce in SQL server basically acts like a Case statement i.e. if value in one of the column is not available then use the value of the second column, and if that is also not available, then use the third column. … Continue reading

Posted in SQL Server | Tagged | Leave a comment