一、给已有的字段添加默认值(0)
IF NOT EXISTS ( select * from sysobjects where parent_obj in( select id from sysobjects where name='m_vip(表名)') and name = 'DF_m_vip_frequency(约束名)') ALTER TABLE m_vip add constraint DF_m_vip_frequency(约束名) DEFAULT 0 for frequency(字段)