Insert range of value based on SQL where clause count SQL Server 2012, say I have this:

select '12358', resource_code, 'N', '1' from sch_resource
where resource_desc like '%avid%media%comp%dongle'


instead of inserting '1', I want to instead insert 1 to X, where X is:

select count(resource_code) from sch_resource
where resource_desc like '%avid%media%comp%dongle'


Is there an easy way to do this without a loop?

Result, count equal to 7, would look like this:
Wouldn't it just simply be:

select '12358', resource_code, 'N', 
  rn = ROW_NUMBER() OVER (ORDER BY resource_code)
from dbo.sch_resource
where resource_desc like '%avid%media%comp%dongle'
ORDER BY rn;


If in your real code you're selecting more than one (whatever column 1 is), and you want the row numbering to start over with each new value in (whatever column 1 is), then you can say:

select [whatever column 1 is], resource_code, 'N', 
  rn = ROW_NUMBER() OVER 
       (PARTITION BY [whatever column 1 is] ORDER BY resource_code)
from dbo.sch_resource
where resource_desc like '%avid%media%comp%dongle'
ORDER BY [whatever column 1 is], rn;