語法 SET IDENTITY_INSERT [ database.[ owner.] ] { table } { ON | OFF }
參數 database ,是指定的表所駐留的數據庫名稱。
owner 是表所有者的名稱。
table 是含有標識列的表名。
使用舉例子,往數據庫中插入100萬條記錄。
復制代碼 代碼如下:
set identity_insert sosuo8database on declare @count int set @count=1 while @count=1000000 begin insert into sosuo8database(id,userName,userPWD,userEmail) values(@count,'ahuinan','ahuinan','sosuo8.com') set @count=@count+1 end set identity_insert sosuo8database off