«« Next » « Previous
«« Next » « Previous

Link Details

If you want it done right, do it yourself! Login and vote now.
Link 82619 thumbnail

By mswatcher
via objectreference.net
Submitted: May 23 2008 / 12:51

Recently I had to write an insert stored procedure and needed to return the ID of the row I was inserting. While writing my usual bad SQL I came across a fascinating function I’ve never used before, SCOPE_IDENTITY(). Here's short example of how you can use the SCOPE_IDENTITY() function while doing an SQL INSERT to return the identity value of the row just inserted.
  • 2
  • 0
  • 113
  • 24

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.

Voters For This Link (2)



Voters Against This Link (0)