1. 程式人生 > >T-SQL迴圈語句

T-SQL迴圈語句

declare @num int
select @num = 0
while @num < 100
begin
select @num = @num +1;
insert into person(ContactID,FirstName,LastName,EmailAddress) values(@num,'FirstName'+cast(@num as varchar(10)),'LastName'+cast(@num as varchar(10)),'EmailAddress'+cast(@num as varchar(10)));
end