alter table xxx alter location drop default; alter table xxx alter location set default "xxx"; 另外在mysql v5.x版本中blob/text不能有默认值,修改时: BLOB/TEXT column 'xxxxxx(表名称)' can't have a default value query, 原因在于: 1. MYSQL5.x是不允许BLOB/TEXT类型的字段拥有默认值的. 2.
首先查出字段的默认值约束名称,然后根据默认值约束名称删除默认值约束 ) select @constraintName = b.name from syscolumns a,sysobjects b where a.id=object_id('TB_KYSubProject') and b.id=a.cdefault and a.name='Final_Belong_Programme' and b.name like 'DF%' SELECT @constraintName exec('alte
---------增加是否发布订单 if not exists(select 1 from syscolumns where name='iIsRelease' and id=OBJECT_ID('MCYD')) begin ALTER TABLE MCYD ADD iIsRelease INTEGER DEFAULT 1; ENDGO UPDATE mcyd SET iIsRelease = 1 WHERE iIsRelease IS NULLGO declare @name varchar(
--1.取得数据库所有表的默认值: select t3.name as 表名,t1.name as 字段名,t2.text as 默认值 ,t4.name from syscolumns t1,syscomments t2,sysobjects t3 ,sysobjects t4 where t1.cdefault=t2.id and t3.xtype='u' and t3.id=t1.id and t4.xtype='d' and t4.id=t2.id; --取得数据库中已有默认值的脚本 s