sql Set IDENTITY_INSERT的用法
更新时间:2009年03月30日 11:35:46 作者:
SET IDENTITY_INSERT 允许将显式值插入表的标识列中。
语法
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
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
相关文章
sqlserver中比较一个字符串中是否含含另一个字符串中的一个字符
sql中比较一个字符串中是否含有另一个字符串中的一个字符的实现代码,需要的朋友可以参考下。2010-09-09
驱动程序无法通过使用安全套接字层(SSL)加密与 SQL Server 建立安全连接,错误:“The serve
这篇文章主要介绍了驱动程序无法通过使用安全套接字层(SSL)加密与 SQL Server 建立安全连接,错误:“The server selected protocol version TLS10 is not accepted by client,本文给大家介绍的非常详细,需要的朋友可以参考下2023-03-03


最新评论