注册 登录
编程论坛 SQL Server论坛

求助:批量插入数据问题

shuiyouhan 发布于 2010-05-19 21:04, 643 次点击
需要插入大量数据,但是总在红色哪一行报语法错误
declare @i int
declare @count int
declare @rand int

set @count=1
set @i=1

while @i<=300000
begin
set @rand=(select cast( floor(rand()*N) as int)
insert into dbo.db_10000_SLC(Sno,Sdept,Sloe) values(@count,@rand%4,@rand);
set @count=@count+1
set @i=@i+1
end
1 回复
#2
aei1352010-05-20 12:10
应该是set @rand=(select cast( floor(rand()*N) as int)这行出错了,小了个括号 set @rand=(select cast( floor(rand()*N) as int))
1