2009-11-03

SQL Server vs. Identity-only Tables

Using SQL Server, if you want to insert a row into a table that contains only an identity column, you can do it like this:

INSERT INTO mytable DEFAULT VALUES

This circumstance is very unusual, but I have run into it twice... and I forgot how I solved it the first time.