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.
| Author |
Topic |
|
yaman
Posting Yak Master
213 Posts |
Posted - 2009-05-15 : 06:13:40
|
| Sir i have one column in a table is NameWhen i am fetch Data from table then my result set like this id Name1 a2 b3 cwith out changing the table definition . Pls help me out sir .Yaman |
|
|
EugeneLim11
Posting Yak Master
167 Posts |
Posted - 2009-05-15 : 06:16:00
|
| Yaman, What do you want to do? I don't understand. You want the id to be displayed next to the name is it?Select ROW_NUMBER() over (order by Name), Name from Table (MSSQL2005) |
 |
|
|
yaman
Posting Yak Master
213 Posts |
Posted - 2009-05-15 : 06:17:51
|
quote: Originally posted by EugeneLim11 Yaman, What do you want to do? I don't understand. You want the id to be displayed next to the name is it?
Yes sirYaman |
 |
|
|
EugeneLim11
Posting Yak Master
167 Posts |
Posted - 2009-05-15 : 06:23:15
|
| Yaman,You are using MSSQL2005? This will do the trick ;) Select ROW_NUMBER() over (order by [Name]), [Name] from Table check out my blog at http://www.aquariumlore.blogspot.com |
 |
|
|
yaman
Posting Yak Master
213 Posts |
Posted - 2009-05-18 : 08:31:11
|
quote: Originally posted by EugeneLim11 Yaman,You are using MSSQL2005? This will do the trick ;) Select ROW_NUMBER() over (order by [Name]), [Name] from Table check out my blog at http://www.aquariumlore.blogspot.com
Thank u so much sirYaman |
 |
|
|
|
|
|