Wednesday, October 28, 2009

Insert into a table with identity column

this is an easy way to insert into a table with default valus that has a identoty column.

this sample will insert 500 records.


WHILE SCOPE_IDENTITY()<500 OR SCOPE_IDENTITY() IS NULL INSERT INTO test1 default VALUES

No comments: