Improve company productivity with a Business Account.Sign Up
declare @No integer
set @No = 1
while @No <= 50
insert into table1(ItemNo, name)
select 'A_' + cast(@No as varchar), 'some text'
set @No = @No + 1
Open in new window
declare @table as table (StartValue int, EndValue int)
insert into @table values (1,10) -- change this number to required value
;with CTE as (
select StartValue,EndValue from @table union all
select StartValue+1,EndValue from CTE where StartValue+1 <= EndValue)
select 'A_'+CONVERT(varchar,StartValue) ItemNo,'some text' name
A_1 some text
A_2 some text
A_3 some text
A_4 some text
A_5 some text
A_6 some text
A_7 some text
A_8 some text
A_9 some text
A_10 some text
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
Please enter a first name
Please enter a last name
Must be at least 4 characters long.
Join and Comment
Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.
One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.