请问大神SQLSEVER里面怎么循环执行SQL语句?
我有一条SQL语句:
INSERT INTO Persons (LastName, Address) VALUES ('Wilson', 'Champs-Elysees')
--此语句我想执行几次就执行几次,请问在SQL内应该怎么写啊?
CREATE TABLE Persons(Lastname VARCHAR(100), [Address] VARCHAR(100))
INSERT INTO Persons (LastName, [Address]) VALUES ('Wilson', 'Champs-Elysees')
GO 10--执行10次
declare @i int
set @i=0
while @i<10
begin
INSERT INTO Persons (LastName, Address)
VALUES ('Wilson', 'Champs-Elysees')
set @i=@i+1
end