O'Reilly logo

Programming Microsoft® ADO.NET 2.0 Core Reference, 2nd Edition by David Sceppa

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Retrieving Newly Generated Auto-Increment Values

SQL Server, Access, Sybase, MySQL, and other databases use auto-increment columns, also referred to as identity columns. (Oracle offers similar scenarios through its sequences.) You can insert a new row into a table, and the database will generate a new value for the auto-increment column for that row. Many tables in the Northwind database—such as Employees, Orders, and Products—use auto-increment columns for their primary keys.

How does working with auto-increment columns differ from general scenarios that require refreshing the conents of the row after performing an update? In the previous examples, the query executed to refresh the contents of the row used the value of the primary key columns ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required