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 |
|
cmspot
Starting Member
44 Posts |
Posted - 2008-03-15 : 15:25:05
|
| Hello Guys!I have an important for me and maybe easy question for you...I want to take the results of a select but i want the first column to be an auto incresement Number...For exampleaa Name Number 1 Alexander Papadopoulos 2122222222 .... ...345How Can this happen?I sell my mother in law.Is anybody interested? |
|
|
TiGGi
Starting Member
29 Posts |
Posted - 2008-03-15 : 15:31:46
|
| SET your AA field as Primary Key and make it to be Identity Column |
 |
|
|
cmspot
Starting Member
44 Posts |
Posted - 2008-03-15 : 15:45:36
|
| My Select Is not From One table....It is a nested query There is no identity Columnfor example Select c.Custname , c.custid , r.rentdate , r,returndateFrom Customers c , rents rWhere c.Custid = r.custidAll I want is an extra auto numeric Column in my select... |
 |
|
|
TiGGi
Starting Member
29 Posts |
Posted - 2008-03-15 : 16:07:25
|
| http://www.sqlteam.com/article/returning-a-row-number-in-a-query |
 |
|
|
cmspot
Starting Member
44 Posts |
Posted - 2008-03-15 : 16:20:37
|
| I know the way Of using a temporary table but the results canot be read from my application (Or maybe i do not know how(VB 2005))....That's why i have a problem.Is there any other Way than using a temp table?I sell my mother in law.Is anybody interested? |
 |
|
|
jsmith8858
Dr. Cross Join
7423 Posts |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-03-17 : 05:22:54
|
| http://sqlblogcasts.com/blogs/madhivanan/archive/2007/08/27/multipurpose-row-number-function.aspxMadhivananFailing to plan is Planning to fail |
 |
|
|
cmspot
Starting Member
44 Posts |
Posted - 2008-04-12 : 13:21:54
|
quote: Originally posted by madhivanan http://sqlblogcasts.com/blogs/madhivanan/archive/2007/08/27/multipurpose-row-number-function.aspxMadhivananFailing to plan is Planning to fail
Thank you Friend it worked so Well! I sell my mother in law.Is anybody interested? |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-04-14 : 03:24:47
|
quote: Originally posted by cmspot
quote: Originally posted by madhivanan http://sqlblogcasts.com/blogs/madhivanan/archive/2007/08/27/multipurpose-row-number-function.aspxMadhivananFailing to plan is Planning to fail
Thank you Friend it worked so Well! I sell my mother in law.Is anybody interested?
Thanks MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|