• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
聞道有先后,术业有专攻
习惯成自然
博客园    首页    新随笔    联系   管理    订阅  订阅

sql 手写建表+插入数据

 1create database data_Test  --创建数据库data_Test 
 2GO 
 3use data_Test 
 4GO 
 5create table tb_TestTable   --创建表 
 6( 
 7    id int identity(1,1) primary key, 
 8    userName nvarchar(20) not null, 
 9    userPWD nvarchar(20) not null, 
10    userEmail nvarchar(40) null 
11) 
12GO

 

然后我们在数据表中插入2000000条数据:

 

 1--插入数据 
 2set identity_insert tb_TestTable on 
 3declare @count int 
 4set @count=1 
 5while @count<=2000000 
 6begin  
 7    insert into tb_TestTable(id,userName,userPWD,userEmail) values(@count,'admin','admin888','lli0077@yahoo.com.cn') 
 8    set @count=@count+1 
 9end 
10set identity_insert tb_TestTable off
posted @ 2009-06-30 21:04  张立余  阅读(469)  评论(0)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3