New Post has been published on Varinder Sandhu 's Blog
New Post has been published on http://www.varindersandhu.in/2012/06/01/sql-server-2008-get-the-next-identity-value/
SQL Server 2008 - Get the next Identity Value
Question: How to get the next Identity Value in SQL Server 2008?
<!-- google_ad_client = "pub-2404605494811633"; google_alternate_color = "FFFFFF"; google_ad_width = 468; google_ad_height = 60; google_ad_format = "468x60_as"; google_ad_type = "text_image"; google_ad_channel =""; google_color_border = "FFFFFF"; google_color_link = "0000FF"; google_color_bg = "FFFFFF"; google_color_text = "000000"; google_color_url = "008000"; google_ui_features = "rc:6"; //-->
Answer: It is very simple to the get the identity value in SQL Server. Let’s see with the example below
Lets‘s create some dummy data as mentioned below …
SQL Server 2008 – Get the next Identity Value
In SQ Server, there are two functions IDENT_CURRENT and IDENT_INCR. With the help of these funtions, we can get next value Identity.
IDENT_CURRENT: It returns the last identity value generated for a specified table or view. The last identity value generated can be for any session and any scope.
IDENT_INCR: It Returns the increment value (returned as numeric (@@MAXPRECISION, 0)) specified during the creation of an identity column in a table or view that has an identity column.
Get the Last Identity Value as below…
SQL Server 2008 – Get the next Identity Value
Get the Identity Increment
SQL Server 2008 – Get the next Identity Value
Get the next Identity Value
SQL Server 2008 – Get the next Identity Value
Hope this help you.











