| | |
How to add an index column whose values you can retrieve
Please support our MS SQL advertiser: Intel Parallel Studio Home
Thread Solved |
•
•
Join Date: Aug 2009
Posts: 4
Reputation:
Solved Threads: 0
I would like to add a column to an existing table, where the new column would only have running numbers starting from 1. If I've understood correctly, the "create index" command is not the right way to do this, as that's attached to just certain columns to speed up querying.
The reason why I want this is that after exporting the data from the database I would still need to know the order of the rows.
The reason why I want this is that after exporting the data from the database I would still need to know the order of the rows.
Last edited by Smirgu; Aug 5th, 2009 at 6:27 am.
sql Syntax (Toggle Plain Text)
CREATE TABLE TestTable ( SomeInt INT, SomeString VARCHAR(10) ) GO --This adds an auto number column ALTER TABLE TestTable Add RowNumber INT identity(1, 1)
•
•
Join Date: Aug 2009
Posts: 4
Reputation:
Solved Threads: 0
•
•
•
•
sql Syntax (Toggle Plain Text)
CREATE TABLE TestTable ( SomeInt INT, SomeString VARCHAR(10) ) GO --This adds an auto number column ALTER TABLE TestTable Add RowNumber INT identity(1, 1)
![]() |
Similar Threads
- need to populate the single column out of mulitple colums, (ASP.NET)
- Sql command to add new data using store values? (C#)
- split and assign values in a file. (Perl)
- PLS I NEED YOUR HELP! Help on Reading and Editing of already Written CODE on php! (PHP)
- How to add not null column in SQL Server 2005 (MS SQL)
- retrieve data by VB.Net (VB.NET)
- Using MySQL with PHP - Tutorial by Herong (MySQL)
- XML Serialization (C#)
Other Threads in the MS SQL Forum
- Previous Thread: need help on replacing a value in a field (MSSQL)
- Next Thread: SQL relational Expressions
| Thread Tools | Search this Thread |






