SqlShare.com Logo
 
Skip Navigation Links
Home
Video List
Events
Classes
About Us
Login / Register
Subscribe RSS Feed 

Confio Ignite 8

Using Scope_Identity()

Scope_Identity is the best way to get the identity value of a just inserted row. It's a drop in replacement for @@Identity and a good way to make sure that you don't have problems in the future if someone adds a trigger that inserts into another table with an identity column.

Duration:
2 mins 36 secs
Skill Level:
100
Rating:
4.24 out of 5
Publish Date:
February 11, 2010
Using Scope_Identity() You must be logged in to view this video.  
Bookmark and Share
 
1=Poor, 3=Good, 5=Excellent

About the Author

Image of Andy Warren
Andy Warren is a software trainer focusing on SQL Server, a member of the PASS Board of Directors, and a principal in this site - SQLShare.com.

References

There are no downloads or recommended reading links for this video

Comments
Nasrin on 2/11/2010
too fast and the script is too small to read.

Joshua Clausen on 2/11/2010
good, quick demo.. good tip

Steve on 2/11/2010
http://blog.sqlauthority.com/2009/03/24/sql-server-2008-scope_identity-bug-with-multi-processor-parallel-plan-and-solution/

John O'Sullivan on 2/11/2010
an excellent reminder

Martin Miller on 2/11/2010
Thanks Andy. -Martin

Denise Tsubota on 2/11/2010
very nice. well put together and brief

Munna Bhai on 2/11/2010
Really a great presentation. Thanks a lot.

mark brito on 2/11/2010
Important for auditing!

Roman Yusfin on 2/11/2010
Excellent, concise video - a little more contrast/clarity to the code text.

yeskay on 2/11/2010
good

Kamen Angelov on 2/11/2010
Ok, but in trigger on delete must use DELETED table.

Arun on 2/13/2010
very good

Sneha on 2/15/2010
forgot to state the difference between @@Identity and SCope_Identity. could have talked little slower

raghu on 2/18/2010
Can we have difference between @@Identity and SCope_Identity?

Rob Wingate on 2/18/2010
Great tip

Derek on 11/29/2010
I can't read the screen very well--the same complaint that seems to come up regularly here, yet the videos continue to be made in the same size font.

Mahesh Jakhmola on 1/4/2011
That was quite fast , would have better if the pace was a bit slow while he was explaining the thnigs

Jamshid Nouri on 1/4/2011
great demo! But, content text so small to watch. Need zoom in action for text clarity. Thanks,

Will Casey on 1/4/2011
Clear succint explanation, thanks.

Rick on 1/4/2011
I wich you explained where @@identity can be an issue.

Stéphane Thinel on 1/4/2011
I do not have enough experience to judge the quality of informations given but my gut tells me this is excellent. When I put the video full screen, everything is blurry, like if the resolution was not big enough, but it doesn't make it impossible to watch

Tom Hamilton on 1/4/2011
Thanks - great stuff continues into the new year

Kasey Wheeler on 1/4/2011
Good vid.

Joe DeMarco on 1/4/2011
Huge! I use @@IDENTITY all over the place.

Thomas Chai on 1/4/2011
Great!

Bridget on 1/4/2011
couldn't see due to font size

race on 1/4/2011
Video quality was not really as good.

Jonathan on 1/4/2011
Would have liked to have seen what @@identity would have returned.

Krishna Singaraju on 1/4/2011
Good refresher

Dexter Jones on 1/4/2011
Good tip, Andy. But it would have been nice to see the Identity issue demonstrated as well.

Ryan on 1/4/2011
Need to explain better why scope_identity is better than @@identity. Demonstrate the issue with the old way and the how the new way avoids it.

Bobby on 1/4/2011
Any chance of improving the picture quality? Whenever you expand to full screen the picture becomes blurry. Thanks!

John Breidenbach on 1/4/2011
It would be better If I started with the scope Identity video

Raymond Zayas on 1/4/2011
You should list prerequisite videos. I'm nowhere near this level of fluency in SQL and would like to view videos that lead up to triggers and what now. Is there a db od beginner videos for dummies I can watch?

Mat on 1/4/2011
good tip. also just watching running sql is so helpful while learning.

Chris Kelly on 1/4/2011
It would have been nice for you to show the problem using the @@IDENTIY after you added the Trigger to the table and that it would have returned the improper identity value.

Shilpa on 1/4/2011
great video

Terrance on 1/5/2011
That was very informative.

P Gerb on 1/7/2011
bounced around to fast and talked to fast.



Must Be Logged In
 

How Do I Become a Video Author? |  Newsletter History

Copyright © Fourdeuce, Inc., 2005-2009. All Rights Reserved | Privacy Policy | Terms & Conditions