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
 General SQL Server Forums
 New to SQL Server Programming
 Dynamic indexing

Author  Topic 

dovesdale
Starting Member

11 Posts

Posted - 2007-07-24 : 02:49:37
How will i dynamically generate number for my selcted rows

eg: output

coloumn 1 Coloumn 2 Column 3
Priority 1 Speciality Angography
Priority 2 Country India
Prority 3 xxxx yyyyy

I want the cloumn 1 to be genrated dynamically and it should go
on like 1 2 3 4


SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-07-24 : 02:55:30
SELECT 1 + ABS(CHECKSUM(NEWID())) % 4


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

dovesdale
Starting Member

11 Posts

Posted - 2007-07-24 : 07:35:03
Pseso

I didt get u

can u please help

my situation is as follows
(pls use nothwind database)
When running this querry "SELECT OrderDate, RequiredDate
FROM Orders"

you will get multiple rows with coloumn names orderdate and required date

eg:

Orderdate requiredDate
7/4/1996 8/1/1996
"" ""

I want to add a dynamic serial infront of it and need to fetch taht in querry

my output should be like this

eg:


SerialNum Orderdate requiredDate
1 7/4/1996 8/1/1996
2 7/5/1996 8/16/1996






Go to Top of Page
   

- Advertisement -