Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Howto: Provide Default value when ADDING COLUMN
Message
 
 
À
05/11/2008 10:33:13
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Versions des environnements
SQL Server:
SQL Server 2000
Divers
Thread ID:
01359846
Message ID:
01359847
Vues:
26
ALTER TABLE [dbo].[IndividualAttribsMeta] 
	ADD [PlaysBridge] varchar(250) NOT NULL DEFAULT 'Plays Bridge'
>Hi
>
>See the following T-SQL
>
>
>ALTER TABLE [dbo].[IndividualAttribsMeta] 
>	ADD [PlaysBridge] varchar(250) DEFAULT 'Plays Bridge'
>
>
>What I would like to do is add the [PlaysBridge] column to the [dbo].[IndividualAttribsMeta] table and have the value 'Plays Bridge' inserted for this column in every row, within the same transaction covering the ALTER TABLE/ADD COLUMN action. When I run the above command, all I get is a Null as the column value. As far as "every row" is concerned, there will only ever be a single row in this table.
>
>After looking at SQL BOL, I get the feeling that this will not be possible but, if anyone has an idea, I would appreciate it.
>
>Thanks,
>
>-=G
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform