Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Howto: Provide Default value when ADDING COLUMN
Message
De
05/11/2008 10:45:52
 
 
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:
01359855
Vues:
29
Hey Sergey,

Works like a charm! You are still and always will be "The Man" :)

Thanks for the super-quick reply - it's appreciated.

Best

-=Gary




>
>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
-=Gary
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform