Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Insert multiple columns in the existing table
Message
 
 
À
Tous
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Titre:
Insert multiple columns in the existing table
Versions des environnements
SQL Server:
SQL Server 2005
Divers
Thread ID:
01315148
Message ID:
01315148
Vues:
57
Hi everybody,

I have a big table in which I need to add several columns in the middle of the columns list.

These are my new fields I need to insert into the columns list.
[Title] [nvarchar](15) NOT NULL,
	[Occupation] [nvarchar](50) NULL,
	[BusinessName] [nvarchar](75) NULL,
	[BusAdd1] [nvarchar](50) NULL,
	[BusAdd2] [nvarchar](25) NULL,
	[BusCity] [nvarchar](22) NULL,
	[BusState] [char](2) NULL,
	[BusZip] [char](7) NULL,
	[Pager] [char](12) NULL,
	[Fax] [char](12) NULL,
	[BusinessPhone] [char](12) NULL,
	[Anniversary] [datetime] NULL,
	[Affiliation] [nvarchar](70) NULL
I can do it in the Designer one by one, but is it a simple way to change the table using script (preserving the original columns and data)?

I assume that with ALTER TABLE command I would add columns at the bottom of the list.

Tnanks in advance.

UPDATE. Ok, according to this http://www.bobsgear.com/display/ts/Adding+Column+After+Another+Column+-+SQL+Server+2005 and articles referenced there I can discard the idea for now and do it at the bottom.
If it's not broken, fix it until it is.


My Blog
Répondre
Fil
Voir

Click here to load this message in the networking platform