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.
| Author |
Topic |
|
KarlKaiser
Starting Member
2 Posts |
Posted - 2006-05-16 : 16:39:14
|
| Well here's one of those excruciatingly simple obstacles:In SQL Server 2005 (Mgmt Studio): according to BOL, the syntax to set a default value for an existing column is:ALTER TABLE MyCustomers ALTER COLUMN CompanyName SET DEFAULT 'A. Datum Corporation'However, when I Check:alter table CommissionPayment alter column Amount Set Default 0I get the error message:"Incorrect syntax near the keyword 'Set'."No other combinations of this syntax work.Help! What am I missing? |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2006-05-16 : 16:54:55
|
| Here's how I do it in 2000:ALTER TABLE dbo.MyCustomers ADD CONSTRAINT ConstraintName DEFAULT 'A. Datum Corporation' FOR CompanyNameTara Kizeraka tduggan |
 |
|
|
KarlKaiser
Starting Member
2 Posts |
Posted - 2006-05-16 : 17:00:52
|
| Well thanks! That worked. Too bad the BOL is wrong on this one. |
 |
|
|
|
|
|