3
I have to add, 1000 records in a given table. It contains the Field Name
.
I have the Script, which does the mass insertion. However, the primary key of this table is a uniqueidentifier
(Guid()
) how can I do this using this approach.
Follow the script for primary key creation int
declare @id int
select @id = 1
while @id >=1 and @id <= 1000
begin
insert into client values(@id, 'jack' + convert(varchar(5), @id), 12)
select @id = @id + 1
end
Don’t you better set the
id
asidentity
on your table?– Sorack
@Sorack, in real as he is a uniqueidentifier, I thought not having the need.
– Renan Carlos