简单的插入语句,谢谢了~ Declare @I IntSet @I=1While @I<11 Begin insert into shopuser (username,userpassword) values (@I,'123456'); Set @I=@I+1 End 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 --insert into shopuser (username,userpassword) values ('1','123456');create table shopuser( username varchar(10) not null, userpassword varchar(20) not null,)Declare @iCount intSet @iCount=1While @iCount<11 Begin insert into shopuser (username,userpassword) select @iCount,'123456'; Set @iCount=@iCount + 1 Endselect * from shopuserdrop table shopuser结果:1 1234562 1234563 1234564 1234565 1234566 1234567 1234568 1234569 12345610 123456 declare @i intset @i=1while @i<=10begininsert into shopuser (username,userpassword) values (@i,'123456')@i=@i+1endgo 求一sql 存储过程 求 此函数的 反向函数 group by 和distinct 怎么隐含有排序?怎样去掉这个顺序? 如何正确的使用SQLServer的事务日志 如何往sqlserver2000数据库中插入回车换行? 求教(关于SQL6.5) MYSQLDUMP报错 这个存储过程该样写? 如何通过自定义函数返回动态表 测试数据已经准备完毕,请问SQL语句写法,请邹建、jinjazz等高手不吝赐教,谢谢! 未能找到存储过程是何缘故?
create table shopuser
(
username varchar(10) not null,
userpassword varchar(20) not null,
)Declare @iCount int
Set @iCount=1
While @iCount<11
Begin
insert into shopuser (username,userpassword)
select @iCount,'123456';
Set @iCount=@iCount + 1
End
select * from shopuserdrop table shopuser
结果:
1 123456
2 123456
3 123456
4 123456
5 123456
6 123456
7 123456
8 123456
9 123456
10 123456
set @i=1
while @i<=10
begin
insert into shopuser (username,userpassword) values (@i,'123456')
@i=@i+1
end
go