Top "Scope-identity" questions

Inserting into Oracle and retrieving the generated sequence ID

I have a handful of raw SQL queries for SQL Server which use SCOPE_IDENTITY to retrieve the generated ID …

sql oracle stored-procedures identity-column scope-identity
SCOPE_IDENTITY() for GUIDs?

Can anyone tell me if there is an equivalent of SCOPE_IDENTITY() when using GUIDs as a primary key in …

sql sql-server guid uniqueidentifier scope-identity
IDENT_CURRENT returns the last identity value but SCOPE_IDENTITY does not

I have a SQL Server as backend for an asp.net application. Multiple people might insert data in the same …

sql-server scope-identity
Why does select SCOPE_IDENTITY() return a decimal instead of an integer?

So I have a table with an identity column as the primary key, so it is an integer. So, why …

sql-server primary-key scope-identity
How to obtain SCOPE_IDENTITY() from INSERT run in EXEC() statement

I am building a dynamic insert statement within a stored procedure. I build up the sql syntax in a variable …

sql sql-server scope-identity
Return id after insert C# using SQL Server

I know this question has been on this site many times, but I can't get my code working. I have …

c# asp.net sql-server return-value scope-identity
Is there any way to use SCOPE_IDENTITY if using a multiple insert statement?

I will import many data rows from a csv file into a SQL Server database (through a web application). I …

c# .net sql spring.net scope-identity
How do I cast Scope_Identity() to Int?

So Scope_Identity() returns an ?-Byte Numeric Type in SQL Server. That is not awesome. Is there a safe way …

sql-server scope-identity
T-SQL: returning the new INSERT identity to C#

i'm putting values into SQL Server using a Stored Procedure. The Procedure will add an ID to the row that …

c# sql return-value scope-identity
vb.net get the last ID and display it

i need to get the last ID from a table and display it. I've tried Scope_Identity() but somehow i …

sql-server vb.net scope-identity