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 |
|
companionz
Yak Posting Veteran
54 Posts |
Posted - 2009-09-14 : 12:21:45
|
| Hi,Alter table not working (SQL 2005)ALTER TABLE dbo.test ALTER COLUMN LastUpdateDate SET DEFAULT getdate()Getting error : "Incorrect syntax near the keyword 'SET'." |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-09-14 : 13:05:03
|
| it should beALTER TABLE dbo.test ALTER COLUMN LastUpdateDate datetime DEFAULT getdate() |
 |
|
|
companionz
Yak Posting Veteran
54 Posts |
Posted - 2009-09-15 : 03:28:49
|
| Now getting this error:Incorrect syntax near the keyword 'DEFAULT'. |
 |
|
|
bklr
Master Smack Fu Yak Hacker
1693 Posts |
Posted - 2009-09-15 : 04:03:32
|
| alter table test add constraint constraintname default (getdate()) for LastUpdateDate |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-09-16 : 13:29:18
|
quote: Originally posted by companionz Now getting this error:Incorrect syntax near the keyword 'DEFAULT'.
ALTER TABLE dbo.test ALTER COLUMN LastUpdateDate datetime NOT NULLCONSTRAINT AddDateDfltDEFAULT getdate() |
 |
|
|
|
|
|