On a computer that is running Windows Vista, Windows Server 2008, or Windows XP, an incorrect value is returned when an application queries the identity column value of a newly inserted row in various versions of SQL Server 2005 and of SQL Server 2000
Applications that use the ActiveX Data Objects (ADO) interface in the following scenario may experience functionality issues:
- An application connects to Microsoft SQL Server 2005, to SQL Server 2005 Express Edition, to Microsoft SQL Server 2000, or to SQL Server Desktop Engine (also known as MSDE 2000).
- The application uses the SET NOCOUNT ON statement for the connection.
- The application inserts a row into a table that has an identity column by using a Microsoft ActiveX Data Objects (ADO) client-side cursor.
Note: This issue only occurs if the application uses a client-side cursor. If the application uses a server-side cursor, the application is not affected.
When the application queries the identity column value of the newly inserted row, the value “0″ is returned incorrectly. This may cause an application to malfunction or even data loss. Whether a malfunction or data loss occurs depends on how the application handles this scenario.
This problem exists in the Microsoft Data Access Components (MDAC) components of the following Windows operating systems:
- Windows Vista Service Pack 1
- Windows XP Service Pack 2 with hotfix 940569
- Windows XP Service Pack 3
- Windows Server 2008
To prevent this problem, install the hotfix that is described in this article.
For more information on this issue, including potential causes, workarounds, and resolutions, see: Microsoft KB Article KB951937.