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 |
|
ofsouto
Starting Member
22 Posts |
Posted - 2005-06-17 : 13:20:40
|
| I want to show all registers from a table(CODE, DESCRIPTION) and show an additional collum with the row number(INCREMENT).Select * from table_1RESULT:CODE DESCTIPTION INCREMENT-------- ------------------------- -----------03354718 FIRST_DESCRIPTION 154654654 SECOND_DESCRIPTION 262173620 THIRD_DESCRIPTION 3How can I get it?Thank you very much |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2005-06-17 : 13:25:58
|
Select identity(1,1) as inc, * into #tempfrom table_1select * from #tempGo with the flow & have fun! Else fight the flow |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-06-18 : 03:34:56
|
| Mladen, when I run that query, I get the errorServer: Msg 170, Level 15, State 1, Line 1Line 1: Incorrect syntax near '1'.anything wrong?MadhivananFailing to plan is Planning to fail |
 |
|
|
Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)
7020 Posts |
Posted - 2005-06-18 : 13:37:36
|
One parameter was missing:select identity(int,1,1) as inc, * into #tempfrom table_1select * from #temp CODO ERGO SUM |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-06-20 : 00:43:05
|
| Yes, Datatype is missing. ThanksMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|