我使用ms sql 2008我有问题要在特定表的列上添加默认值。
ALTER TABLE dbo.CmsAuthors
ALTER COLUMN IsContentAuthorPublished
ADD CONSTRAINT DF_CmsAuthors_IsContentAuthorPublished DEFAULT 0
你能告诉我这里我做错了什么吗?
由于
答案 0 :(得分:5)
ALTER TABLE dbo.CmsAuthors
ADD CONSTRAINT DF_CmsAuthors_IsContentAuthorPublished
DEFAULT 0 FOR IsContentAuthorPublished
答案 1 :(得分:1)
试试这个:
ALTER TABLE dbo.CmsAuthors
ALTER COLUMN IsContentAuthorPublished
ADD CONSTRAINT DF_CmsAuthors_IsContentAuthorPublished DEFAULT 0
for <Column Name>