批量插入2-100
A表
ID
批量插入A表ID 从指定的最小数到最大数
比如 2到200的数字
------解决方案--------------------declare @i int
set @i = 2
while @i < 200
begin
insert into table
values(convert(varchar(25),@i))
set @i = @i + 1
end
------解决方案--------------------declare @i int
set @i=2
while @i<=200
begin
insert into A(id)
values(@i)
set @i=@i+1
end
------解决方案--------------------declare @i int
set @i = 2
while @i <= 200
begin
insert into ta values (@i)
set @i=@i+1
end
------解决方案--------------------IF OBJECT_ID('T_A') IS NOT NULL
DROP TABLE T_A
GO
CREATE TABLE T_A(ID INT)
GO
DECLARE @ID INT
SET @ID = 2
WHILE @ID<=200
begin
INSERT INTO T_A VALUES(@ID)
SET @ID = @ID+1
end
SELECT * FROM T_A
------解决方案--------------------我也复制一个?