USE [master]
GO
/****** Object: Table [dbo].[Users] Script Date: 02/10/2011 23:32:17 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF not EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Users]') AND type in (N'U'))
begin
CREATE TABLE [dbo].[Users](
[id] [uniqueidentifier] NOT NULL,
[username] [nvarchar](50) NULL,
[password] [nvarchar](50) NULL,
[type] [nvarchar](50) NULL,
CONSTRAINT [PK_Users] PRIMARY KEY CLUSTERED
(
[id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
end
GO
ALTER TABLE [dbo].[Users] ADD CONSTRAINT [DF_Users_id] DEFAULT (newid()) FOR [id]
GO
declare @NUM numeric(5,0)
declare @SQLSTR nvarchar(500)
set @NUM = 0
START:
if @NUM>=800
begin
goto FINISH
end
else
begin
set @NUM+=1
set @SQLSTR='Insert into [dbo].[Users]
(
username,
[password],
[type] )
values(
''User'+Convert(nvarchar(5),@NUM)+''',
''123'',
''2'')'
exec(@SQLSTR)
print @SQLSTR
print @NUM
goto START
end
FINISH:
sql mark
原创huangchaosuper 博主文章分类:百度迁移 ©著作权
©著作权归作者所有:来自51CTO博客作者huangchaosuper的原创作品,请联系作者获取转载授权,否则将追究法律责任
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章