Monday, 13 July 2015

How To INSERT No.Of Records By Using T-SQL

Just Create  One Table Like
Create Table Prods1 (Pid int,PName varchar(20),Qty Int)

After complete table creation, Next following below code.

declare @pid int=1
while @pid<=1000000000000000
begin
insert into prods1 values(@pid ,'Sweet'+CONVERT(varchar(20),@pid),40)
select @pid=@pid+1
end

No comments:

Post a Comment