views:

34

answers:

2

I have a table with one and only one column, which is an identity column (PK) of this table. How to insert row in this table?

INSERT INTO table_name 

doesn't work, neither does:

INSERT INTO table_name() VALUES()

VALID SOLUTION FROM THE ANSWER:

INSERT INTO table_name DEFAULT VALUES
+3  A: 
DECLARE @TABLE TABLE
(
    ID INT IDENTITY(1,1) PRIMARY KEY 
)

INSERT INTO @TABLE DEFAULT VALUES

SELECT * FROM @TABLE
Meff
http://articles.techrepublic.com.com/5100-10878_11-5794899.html
Andy White
+1  A: 

You should enable identity insert on the table, so that you can insert values into the column.

SET IDENTITY_INSERT table_name ON
pipelinecache