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
 SQL Server 2012 Forums
 Analysis Server and Reporting Services (2012)
 Data sorting

Author  Topic 

Alex_Chivu
Starting Member

1 Post

Posted - 2015-03-05 : 11:27:26
Hi everybody,

I am new to sql, so please bear with me on what might be a simple thing!
I've got a huge database (6 mil records)and I would need to add an autonumber column, having the data sorted by a specific column. As it seems, when adding an autonumber, with Identity function, I cannot actually sort the data by the column I need, but the numbering is allocated by an implicit order. I am working with SQL Server Management Studio.

Thanks in advance

gbritton
Master Smack Fu Yak Hacker

2780 Posts

Posted - 2015-03-05 : 20:12:46
First off, any sorting happens when you query the data and include an ORDER BY clause. Adding a new column to capture some ordering as a an integer is a waste of space. And, what would you do if a new role was inserted in the future.

Also, 5 million rows is not really so very big.
Go to Top of Page
   

- Advertisement -