25 Mar

Wartość ID po komendzie INSERT

Here is a way for getting the auto generated id after insert in MSSQL (how to get the Primary ID after a SQL insert).


2.

Then call the stored procedure in a sql command:

3.

4.

This new function returns the last IDENTITY value produced on a connection and by a statement in the same scope, regardless of the table that produced the value.

5.

This is everyone’s favorite function, unchanged from earlier versions of SQL Server. It returns the last IDENTITY value produced on a connection, regardless of the table that produced the value, and regardless of the scope of the statement that produced the value.

Dodaj komentarz

Twój adres email nie zostanie opublikowany. Pola, których wypełnienie jest wymagane, są oznaczone symbolem *

Enter Captcha Here : *

Reload Image