Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
select scope_identity() would give one record while
the statement you used
select scope_identity() from orders would return the same value as many times as the number of rows in the orders table.
I was referring to another issue. This:DotNetGnat said:can you explain a little more. Because. If suppose i have 50 records in my table and i enter a new record i get 51 with either of these...
SELECT @@identity|scope_identity() as orderid from orders
BOL said:SCOPE_IDENTITY and @@IDENTITY will return last identity values generated in any table in the current session. However, SCOPE_IDENTITY returns values inserted only within the current scope; @@IDENTITY is not limited to a specific scope.