0

i have table propertybag, it's have only one identity coloumn

fo eg

   propertybagid identity(1,1)

i want to insert this value to this column one by one by query how?

plz reply soon

3 Answers 3

4
Insert into propertybagid default values
Sign up to request clarification or add additional context in comments.

Comments

1
INSERT T DEFAULT VALUES 

Or to insert multiple rows (up to 2048 at a time using the spt_values table)

SET IDENTITY_INSERT t ON
INSERT INTO t (id) 
SELECT Number + COALESCE(IDENT_CURRENT('t'),0) + 1
FROM master.dbo.spt_values
where type='p' and number < 2048
SET IDENTITY_INSERT t OFF

Comments

0
INSERT INTO <tablename> DEFAULT VALUES;

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.