In SQL Server, how can I insert data into a table that has just one column which is of identity type?
Such as insert into the following table t.
How can I write the insert statement?
CREATE TABLE t
(
id INT IDENTITY(1, 1) PRIMARY KEY
)
Great thanks.
To insert a single value
Or to insert multiple rows on SQL Server 2008+
To insert multiple rows in a single statement on previous versions would require the values to be entered explicitly, e.g. as below.