How To Retrieve Identity Column After Insert Using RDO (170147)
The information in this article applies to:
- Microsoft Visual Basic Learning Edition for Windows 6.0
- Microsoft Visual Basic Professional Edition for Windows 6.0
- Microsoft Visual Basic Enterprise Edition for Windows 6.0
- Microsoft Visual Basic Enterprise Edition for Windows 5.0
This article was previously published under Q170147 For a Microsoft Visual Basic .NET version of this
article, see
320141. SUMMARY SQL Server Identity columns automatically increment their
value when a new record is added to the table, which makes them very useful for
a unique primary key. When using RDO, you may want to know what the new value
of the Identity column is after inserting a new record with the RDO
Addnew/Update methods, or with a SQL INSERT statement.
SQL Server
maintains an environment variable named @@IDENTITY that stores the value of the
last Identity column added. This environment variable can be queried several
different ways from RDO. REFERENCES For additional information of User Connection Designer,
please see the following article in the Microsoft Knowledge Base: 166281 : How To Create and Implement a UserConnection
(c) Microsoft Corporation 1997, All Rights Reserved. Contributions by
Adrian Chiang, Microsoft Corporation
Modification Type: | Minor | Last Reviewed: | 7/1/2004 |
---|
Keywords: | kbhowto KB170147 |
---|
|