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)
 Alter Table - Add Column

Author  Topic 

Looper
Yak Posting Veteran

68 Posts

Posted - 2008-05-21 : 04:15:25
Is there a way when adding a new column to a table to specify exactly where it is positioned.

I am using the following:

ALTER TABLE dbo.t_EmergencyContact
ADD Telephone2 VARCHAR(16) NULL


Other fields in Table:

Name
Address
Telephone1
Other ..etc

I want the new field to go between Telphone1 and Other how can I achieve this as the above code adds it to the end.

thanks

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-05-21 : 04:18:13
No you can't.
And it shouldn't matter to you either, unless you rely on production code that includes "SELECT *"...



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-05-21 : 04:28:42
quote:
Originally posted by Looper

Is there a way when adding a new column to a table to specify exactly where it is positioned.

I am using the following:

ALTER TABLE dbo.t_EmergencyContact
ADD Telephone2 VARCHAR(16) NULL


Other fields in Table:

Name
Address
Telephone1
Other ..etc

I want the new field to go between Telphone1 and Other how can I achieve this as the above code adds it to the end.

thanks


You dont really have to worry on position as you can specify the column to be retrieved in postion you want in SELECT query during retrieval.
Go to Top of Page
   

- Advertisement -