34,838
社区成员




'我说的只是针对你哪个为空的情况'
'如果字段都建立索引了,你也别想改了'
Create table a (a int not null)
ALTER table a ALTER COLUMN a int NULL
exec sp_help a--查看系统结构
ALTER table tabname ALTER COLUMN columname type NULL
ALTER tabname ALTER COLUMN colname type NULL
ALTER TABLE ALTER COLUMNname type NULL
use tempdb
go
if object_id('#temp') is not null
drop table #temp
create table #temp(id int not null
,name char(20) not null)
--查看表结构
exec sp_help #temp
--去掉not null
alter table #temp
alter column name char(20) null
--再查看表结构
exec sp_help #temp