SQL Server为字段添加默认值

SQL Server为字段添加默认值

if not exists (
select *
from sys.columns as c
join sys.objects as o on c.default_object_id = o.[object_id]
where c.[object_id] = object_id('DriverTable')
and c.name = 'DriverVan'
)
begin
alter table DriverTable
add default(0) for DriverVan
with values
end
else
print 'default value for DriverVan exists'
go
上一篇:攻防环境配置大全(iss/apache/nginx/tomcat/jboss/weblogic)


下一篇:hdu5880 Family View