Rah*_*ain 4 sql sql-server-2008
在执行以下SQL查询时
alter table tablename add columnname boolean not null default false;
Run Code Online (Sandbox Code Playgroud)
我收到以下错误消息:
The name "false" is not permitted in this context. Valid expressions are constants, constant expressions, and (in some contexts) variables. Column names are not permitted.
我该怎么解决这个问题?建议?
列类型应该是bit
字段.
在SQL中,您使用0
和1
设置bit
字段.这些值在SQL Server Management Studio中显示为false
或true
对应于0
和1
.
alter table tablename add columnname bit not null default 0;
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
6216 次 |
最近记录: |