1--02插入dbo.test表
2--select * from test
3--信息变量为 NumID 从10000增1,Number 从1增1
4--声明变量;
5DECLARE @i int
6DECLARE @NumID int
7DECLARE @Number varchar(50)
8Set @i = 0
9--开始循环插入数据;
10WHILE @i < 5000
11BEGIN
12 Set @i =@i +1
13 SET @NumID =RIGHT(10000 + CAST(@i AS varchar(10)),5)
14 set @Number ='Num' + CAST(@i AS varchar(10))
15 INSERT INTO test (testID,testPlanID,ID,year,Number,tt)
16 VALUES ('1','400',@NumID,'2006',@Number,'asdf1234')
17END
2--select * from test
3--信息变量为 NumID 从10000增1,Number 从1增1
4--声明变量;
5DECLARE @i int
6DECLARE @NumID int
7DECLARE @Number varchar(50)
8Set @i = 0
9--开始循环插入数据;
10WHILE @i < 5000
11BEGIN
12 Set @i =@i +1
13 SET @NumID =RIGHT(10000 + CAST(@i AS varchar(10)),5)
14 set @Number ='Num' + CAST(@i AS varchar(10))
15 INSERT INTO test (testID,testPlanID,ID,year,Number,tt)
16 VALUES ('1','400',@NumID,'2006',@Number,'asdf1234')
17END