Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Get the SQL server identity value before commit
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00777706
Message ID:
00777714
Views:
8
>Anyone know if it’s possible to get the value for an SQL server identify field before a transaction is completed.
>
>Basically I want to add a record to a table, get its PK value which is assigned in SQL server. Then add to some other tables and if everything goes well, commit the transaction to all tables.
>
>Thanks,

You can use SCOPE_IDENTITY( ) or @@Identity to get last identity value. See BOL for details and limitations of each.
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform