Hi
How I Can Get To Last Records in DataBase tthat User Enter?
darab -4 Junior Poster in Training
Recommended Answers
Jump to PostIf you want to get technical, you're advice is bad as well, as scope_identity will:
"SCOPE_IDENTITY(), like @@IDENTITY, will return the last identity value created in the current session, but it will also limit it to your current scope as well. In other words, it will return the last …
Jump to PostIntersting, thank you - and what was your take on using
SELECT IDENT_CURRENT(’tablename’)
Jump to PostCan you find an example? on MSDN here http://msdn.microsoft.com/en-us/library/aa933217(SQL.80).aspx
it looks like it is similar to @@IDENTITY AND SCOPE_IDENTITY but just returning the last id value from any session or scope.
I see a problem if the table is null
http://support.microsoft.com/kb/835188but …
All 12 Replies
darab -4 Junior Poster in Training
sknake 1,622 Senior Poster Featured Poster
rapture 134 Posting Whiz in Training
sknake commented: no. That is unsafe as it creates a race condition. -1
sknake 1,622 Senior Poster Featured Poster
rapture 134 Posting Whiz in Training
sknake 1,622 Senior Poster Featured Poster
rapture 134 Posting Whiz in Training
sknake 1,622 Senior Poster Featured Poster
rapture 134 Posting Whiz in Training
sknake 1,622 Senior Poster Featured Poster
rapture 134 Posting Whiz in Training
sknake 1,622 Senior Poster Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.