Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Howto: Provide Default value when ADDING COLUMN
Message
From
05/11/2008 10:33:13
 
 
To
All
General information
Forum:
Microsoft SQL Server
Category:
Other
Title:
Howto: Provide Default value when ADDING COLUMN
Environment versions
SQL Server:
SQL Server 2000
Miscellaneous
Thread ID:
01359846
Message ID:
01359846
Views:
74
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
Next
Reply
Map
View

Click here to load this message in the networking platform