-- create a table create table dbo.JustOneColumn ( col1 int identity(1, 1) primary key clustered ); go set nocount on; -- insert 1000 records into it: insert into dbo.JustOneColumn default values; go 1000 -- insert another 2000 records. Assuming that -- there are never any deletes, the values -- will not have any holes :) insert into dbo.JustOneColumn default values; go 2000 select max(col1) LastValue from dbo.JustOneColumn; go set nocount off; go drop table dbo.JustOneColumn; go -- output with results to text: Beginning execution loop Batch execution completed 1000 times. Beginning execution loop Batch execution completed 2000 times. LastValue ----------- 3000The above is nasty because it is not set based; just wanted to show the syntax for adding rows to the table with only one identity column.
No one has followed this question yet.