Hi All, If I add a column to a table how do I ensure its position? Through
the GUI via Ent. Mgr I can drag to the right place, is there a way to do
code wise?
TIAhttp://www.aspfaq.com/2528
"Vai2000" <nospam@.microsoft.com> wrote in message
news:%23AgGKg5cGHA.1792@.TK2MSFTNGP03.phx.gbl...
> Hi All, If I add a column to a table how do I ensure its position? Through
> the GUI via Ent. Mgr I can drag to the right place, is there a way to do
> code wise?
> TIA
>|||Without dropping and recreating the table, NO.
This is what EM does in the background.
"Vai2000" <nospam@.microsoft.com> wrote in message
news:%23AgGKg5cGHA.1792@.TK2MSFTNGP03.phx.gbl...
> Hi All, If I add a column to a table how do I ensure its position? Through
> the GUI via Ent. Mgr I can drag to the right place, is there a way to do
> code wise?
> TIA
>|||A 'position' in the table is irrelevant. You can select the columns in any
order you want. The only time a column order might matter is if you do
'select *' which is not recommended.
EM allows you to put a column in a particular 'position' by completely
recreating the entire table. This can be very inefficient if the table has
lots of data, plus indexes constraints and triggers will all have to be
rebuilt.
If you want the same result in code, you have to do a complete re-creation
of the table.
HTH
Kalen Delaney, SQL Server MVP
www.solidqualitylearning.com
"Vai2000" <nospam@.microsoft.com> wrote in message
news:%23AgGKg5cGHA.1792@.TK2MSFTNGP03.phx.gbl...
> Hi All, If I add a column to a table how do I ensure its position? Through
> the GUI via Ent. Mgr I can drag to the right place, is there a way to do
> code wise?
> TIA
>sql
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment