Here is a trick I learned from another users group. It works really
well:
-- Add Row Counter to displayed values...
Select
identity (int, 1, 1) as Row_ID,
Field1,
field2,
field3
into #test
from Store
where active_Ind = 'Y'
and store_desc not like 'closed%'
select * from #test
order by ROW_ID
drop table #test
Gordon Radley
-----Original Message-----
From: Hornak Wayne
[mailto:mssqldba-ezmlmshield-x84458119.[Email address protected]
Sent: Thursday, April 28, 2005 2:13 PM
To: LazyDBA Discussion
Subject: Sequential Number Creation
How do I create a unique sequential number within the result of a sql
statement?
---------------------------------------------------------------------
TO REPLY TO EVERBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
Website : http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html
For additional commands, e-mail: mssqldba-[Email address protected]
MS Sql Server LazyDBA home page