谢谢,但是为什么在SQL Server Enterprise Management 中可以直接修改?
为什么 decimal 转换为float ,即使有默认值也可以?

解决方案 »

  1.   

    企业管理器对表结构的修改大致是这样处理的先生成一个结构相同临时表,但没有约束 ,比如
    create table dbo.Tmp_t1
    (tid int not null,
     tdate datetime not null ,
     norder varchar(15) not null,
    ) on [primary]insert into dbo.Tmp_t1 select * from dbo.t1 tablockxdrop table dbo.t1exec sp_rename N'dbo.Tmp_t1',N'dbo.t1','object'--再添加约束alter table dbo.t1 add constraint 
    UQ_t2 unique noclustered (norder) on [primary]