开发者

insert identity table column value

开发者 https://www.devze.com 2023-01-08 16:14 出处:网络
i have table propertybag, it\'s ha开发者_如何转开发ve only one identity coloumn fo eg propertybagid identity(1,1)

i have table propertybag, it's ha开发者_如何转开发ve 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


Insert into propertybagid default values


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


INSERT INTO <tablename> DEFAULT VALUES;
0

精彩评论

暂无评论...
验证码 换一张
取 消