Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to retrieve SQL Identity Column values?
Message
From
02/10/2001 10:49:25
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
02/10/2001 10:19:08
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00562994
Message ID:
00563026
Views:
28
>I'm using VFP 6 and SQL 2000. Almost all SQL tables have an identity column for the pk. When I add a new record to a view, is there a direct way to retrieve the PK value that was assigned by SQL? I currently do some pretty serious gyrations to pull it off. Must be a quicker way...
>
>TIA
select @@identity as lastid
would return last identity assigned. However you might want to use IDENT_CURRENT too which returns last identity for a specific table (last by any session,any scope).
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform