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.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 alter column error

Author  Topic 

rb1373
Yak Posting Veteran

93 Posts

Posted - 2005-08-26 : 16:49:39
What is wrong with this syntax?

ALTER TABLE MyTable ALTER COLUMN MyColumn BIT NOT NULL DEFAULT 0

I am getting this error
"Incorrect syntax near the keyword 'DEFAULT'."

Thanks,
Ray

rb1373
Yak Posting Veteran

93 Posts

Posted - 2005-08-26 : 16:54:51
This worked!

ALTER TABLE MyTable
ALTER COLUMN MyColumn BIT NOT NULL

ALTER TABLE MyTable add constraint MyDefault default 0 for MyColumn
Go to Top of Page
   

- Advertisement -