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

你可能感兴趣的:(t-sql循环语句,T-SQL循环语句)