sql Set IDENTITY_INSERT的用法

时间:2024-01-14 14:27:47 

语法
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
标签:sql,Set,IDENTITY,INSERT
0
投稿

猜你喜欢

  • Python 数据结构之树的概念详解

    2021-06-24 17:08:25
  • Python lambda表达式用法实例分析

    2022-06-05 12:32:34
  • pytest fixtures装饰器的使用和如何控制用例的执行顺序

    2023-04-11 22:56:09
  • Django原生sql也能使用Paginator分页的示例代码

    2023-11-09 10:00:06
  • js实现九宫格图片半透明渐显特效的方法

    2024-04-19 11:03:55
  • TensorFlow人工智能学习张量及高阶操作示例详解

    2022-04-15 15:37:52
  • MySQL查询条件中放置on和where的区别分析

    2024-01-25 00:22:51
  • sqlserver、mysql获取连接字符串步骤

    2024-01-22 00:49:33
  • 解读数据库的嵌套查询的性能问题

    2024-01-20 17:00:06
  • 科学设计你的网站网页

    2008-03-16 13:48:00
  • electron-builder打包配置详解

    2024-04-17 10:24:54
  • Python语言基础之函数语法

    2021-11-06 23:18:44
  • python实现登录密码重置简易操作代码

    2022-12-08 13:34:43
  • python如何实现不可变字典inmutabledict

    2023-11-20 11:09:46
  • asp get和post数据接收过滤

    2011-04-06 10:52:00
  • 根据DataFrame某一列的值来选择具体的某一行方法

    2021-01-08 20:33:42
  • MySQL实现批量插入以优化性能的教程

    2024-01-25 23:27:53
  • 使用Python横向合并excel文件的实例

    2023-09-19 21:20:18
  • Python jieba库用法及实例解析

    2021-04-15 22:11:44
  • flask SQLAlchemy连接数据库及操作的实现

    2024-01-28 09:23:29
  • asp之家 网络编程 m.aspxhome.com