[program-l] Re: Reordering fields in SQL 2000

  • From: "Charles Steyn" <CharlesS@xxxxxxxxxxxxx>
  • To: <program-l@xxxxxxxxxxxxx>
  • Date: Fri, 23 Sep 2005 13:59:38 +0200

Hi David,

Thanks very much. I hope it's a new feature in SQL Server 2005. It is
strange that in some other database systems like Progress this feature
was always present.

Regards
Charles Steyn

-----Original Message-----
From: program-l-bounce@xxxxxxxxxxxxx
[mailto:program-l-bounce@xxxxxxxxxxxxx] On Behalf Of David Lant
Sent: 23 September 2005 13:37
To: program-l@xxxxxxxxxxxxx
Subject: [program-l] Re: Reordering fields in SQL 2000

Hi,

To the best of my knowledge, there is no feature to reorder fields in an
SQL Server table.  I've had to do this many times myself, and have
always ended up creating a new field in the location I want, copying the
data from the old to the new, and then deleting the old.  Finally,
renaming the new field finishes the job.

I'm not even sure if there is a way to reorder fields using Enterprise
manager.  I asked my sighted colleague a few days ago, and she said
there didn't seem to be an obvious way to do it there either.

Off the top of my head, I'm not even sure how you would script adding a
new field, in such a way that you specify its position among existing
fields.
Logically there must be a way, otherwise how would Enterprise Manager
allow you to insert a new column at a specific location?  But there you
go.  It may just be well hidden.

All the best,

David


-----Original Message-----
From: program-l-bounce@xxxxxxxxxxxxx
[mailto:program-l-bounce@xxxxxxxxxxxxx]
On Behalf Of Charles Steyn
Sent: 23 September 2005 05:56
To: program-l@xxxxxxxxxxxxx
Subject: [program-l] Reordering fields in SQL 2000


Hi list,

I wonder if anybody can help me with this seemingly simple issue. I want
to reorder fields in a SQL Server 2000 table. I know you can use
Enterprise Manager to do this, but I find the visual tools hard to use
and prefer to script all my database changes. Is it possible to reorder
fields using a script or stored procedure?

Thanks and regards.
Charles Steyn

http://www.africon.com/MasterPages/Legalnotice/Legalnotice.htm

** To leave the list, click on the immediately-following link:-
** [mailto:program-l-request@xxxxxxxxxxxxx?subject=unsubscribe]
** If this link doesn't work then send a message to:
** program-l-request@xxxxxxxxxxxxx
** and in the Subject line type
** unsubscribe
** For other list commands such as vacation mode, click on the
** immediately-following link:-
** [mailto:program-l-request@xxxxxxxxxxxxx?subject=faq]
** or send a message, to
** program-l-request@xxxxxxxxxxxxx with the Subject:- faq

** To leave the list, click on the immediately-following link:-
** [mailto:program-l-request@xxxxxxxxxxxxx?subject=unsubscribe]
** If this link doesn't work then send a message to:
** program-l-request@xxxxxxxxxxxxx
** and in the Subject line type
** unsubscribe
** For other list commands such as vacation mode, click on the
** immediately-following link:-
** [mailto:program-l-request@xxxxxxxxxxxxx?subject=faq]
** or send a message, to
** program-l-request@xxxxxxxxxxxxx with the Subject:- faq

http://www.africon.com/MasterPages/Legalnotice/Legalnotice.htm

** To leave the list, click on the immediately-following link:-
** [mailto:program-l-request@xxxxxxxxxxxxx?subject=unsubscribe]
** If this link doesn't work then send a message to:
** program-l-request@xxxxxxxxxxxxx
** and in the Subject line type
** unsubscribe
** For other list commands such as vacation mode, click on the
** immediately-following link:-
** [mailto:program-l-request@xxxxxxxxxxxxx?subject=faq]
** or send a message, to
** program-l-request@xxxxxxxxxxxxx with the Subject:- faq

Other related posts: