--修改表TMPageCustPageDefDet字段Sort字符类型为int型
DECLARE @csname varchar(100)
set @csname=''
select @csname=[name] --约束名称
from sysobjects t
where id=(select cdefault from syscolumns where id=object_id(N'TMPageCustPageDefDet') and name='Sort')
exec('alter table TMPageCustPageDefDet drop constraint '+@csname)
ALTER TABLE dbo.TMPageCustPageDefDet ALTER COLUMN Sort INT NOT NULL
ALTER TABLE TMPageCustPageDefDet add CONSTRAINT DF__TMPageCus__Sort Default ('0') for Sort