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 2000 Forums
 Transact-SQL (2000)
 How to change column order of a table

Author  Topic 

niks_pat
Starting Member

3 Posts

Posted - 2003-03-12 : 09:25:51
Hi,

I need to modify column order of some of my sql server 2k tables because I want to keep related columns together.How can I do this?

Thanks
Nikhil

robvolk
Most Valuable Yak

15732 Posts

Posted - 2003-03-12 : 09:47:36
You need to DROP the current table and re-create it with the columns in the order you want. It doesn't matter what order the columns are in, as you will always specify them by name in a SELECT clause anyway. Just keep the related columns together in the SELECT statement.

Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2003-03-12 : 11:23:11
This questions seems to come up a lot

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=24181



Brett

8-)
Go to Top of Page
   

- Advertisement -