日期:2014-05-17 浏览次数:20539 次
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