Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 display no within sl query

Author  Topic 

imughal
Posting Yak Master

192 Posts

Posted - 2004-06-16 : 06:05:19
hi,

my query is

select name, address from customers.

result shows 50 rec from 1 to 10. i want to add no. field 1 to 50 with sql query just like we can add count. is there anyway to do this thing without adding count in a loop.

regards,
irfan

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2004-06-16 : 06:13:56
is this what u r looking for?

declare @count int
set @count = 1
UPDATE customers SET @count = [no.] = @count + 1



Go with the flow & have fun! Else fight the flow :)
Go to Top of Page
   

- Advertisement -