September 22, 2004 at 3:27 am
I'm writing a script to upgrade a database, part of which involves adding a number of new columns to each table.
So that bit is pretty easy, but if it is possible I would then like those columns to turn up in a certain order within Enterprise Manager.
If I was using Enterprise Manager to add the columns I would use the insert column option.
So is there a way to specify the order the columns turn up in Enterprise Manager, when adding the columns using T-SQL?
September 22, 2004 at 3:56 am
Short answer - no.
Long answer could involve a discussion as to why order of columns would be an issue at all, since there is no order in relational theory ![]()
Anyway, the one and only way to achieve it is to do just like EM does - drop the existing table and create a new one with the columns in the specified order. (yes, that's what happens when you use EM insert column option - there's no special magic there)
.. just don't forget to pull out all data beforehand (if there is any)
/Kenneth
September 22, 2004 at 4:13 am
Right - thanks
September 23, 2004 at 6:24 am
Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply