pageadmin
- 管理员
- 270
- 3138
- 2008-11-18
|
3#
t
T
发表于 2009-12-31 22:45
|只看楼主
以下为mssql server版本的SQL - declare @name varchar(100)
- select @name=b.name from syscolumns a,sysobjects b where a.id=object_id('lanmu1') and b.id=a.cdefault and a.name='target' and b.name like 'DF%'
- exec('alter table lanmu1 drop constraint '+@name);
- declare @name varchar(100)
- select @name=b.name from syscolumns a,sysobjects b where a.id=object_id('lanmu2') and b.id=a.cdefault and a.name='target' and b.name like 'DF%'
- exec('alter table lanmu2 drop constraint '+@name);
- declare @name varchar(100)
- select @name=b.name from syscolumns a,sysobjects b where a.id=object_id('lanmu3') and b.id=a.cdefault and a.name='target' and b.name like 'DF%'
- exec('alter table lanmu3 drop constraint '+@name);
- declare @name varchar(100)
- select @name=b.name from syscolumns a,sysobjects b where a.id=object_id('lanmu3') and b.id=a.cdefault and a.name='prod_order' and b.name like 'DF%'
- exec('alter table lanmu3 drop constraint '+@name);
- declare @name varchar(100)
- select @name=b.name from syscolumns a,sysobjects b where a.id=object_id('template') and b.id=a.cdefault and a.name='target' and b.name like 'DF%'
- exec('alter table template drop constraint '+@name);
- declare @name varchar(100) declare @name varchar(100)
- select @name=b.name from syscolumns a,sysobjects b where a.id=object_id('template') and b.id=a.cdefault and a.name='prod1id' and b.name like 'DF%'
- exec('alter table template drop constraint '+@name);
- declare @name varchar(100)
- select @name=b.name from syscolumns a,sysobjects b where a.id=object_id('template') and b.id=a.cdefault and a.name='prod2id' and b.name like 'DF%'
- exec('alter table template drop constraint '+@name);
- declare @name varchar(100)
- select @name=b.name from syscolumns a,sysobjects b where a.id=object_id('template') and b.id=a.cdefault and a.name='infor1id' and b.name like 'DF%'
- exec('alter table template drop constraint '+@name);
- declare @name varchar(100)
- select @name=b.name from syscolumns a,sysobjects b where a.id=object_id('template') and b.id=a.cdefault and a.name='infor2id' and b.name like 'DF%'
- exec('alter table template drop constraint '+@name);
- declare @name varchar(100)
- select @name=b.name from syscolumns a,sysobjects b where a.id=object_id('lanmu2') and b.id=a.cdefault and a.name='prod1id' and b.name like 'DF%'
- exec('alter table lanmu2 drop constraint '+@name);
- declare @name varchar(100)
- select @name=b.name from syscolumns a,sysobjects b where a.id=object_id('lanmu2') and b.id=a.cdefault and a.name='prod2id' and b.name like 'DF%'
- exec('alter table lanmu2 drop constraint '+@name);
- declare @name varchar(100)
- select @name=b.name from syscolumns a,sysobjects b where a.id=object_id('lanmu2') and b.id=a.cdefault and a.name='infor1id' and b.name like 'DF%'
- exec('alter table lanmu2 drop constraint '+@name);
- declare @name varchar(100)
- select @name=b.name from syscolumns a,sysobjects b where a.id=object_id('lanmu2') and b.id=a.cdefault and a.name='infor2id' and b.name like 'DF%'
- exec('alter table lanmu2 drop constraint '+@name);
- declare @name varchar(100)
- select @name=b.name from syscolumns a,sysobjects b where a.id=object_id('lanmu3') and b.id=a.cdefault and a.name='prod1id' and b.name like 'DF%'
- exec('alter table lanmu3 drop constraint '+@name);
- declare @name varchar(100)
- select @name=b.name from syscolumns a,sysobjects b where a.id=object_id('lanmu3') and b.id=a.cdefault and a.name='prod2id' and b.name like 'DF%'
- exec('alter table lanmu3 drop constraint '+@name);
- declare @name varchar(100)
- select @name=b.name from syscolumns a,sysobjects b where a.id=object_id('lanmu3') and b.id=a.cdefault and a.name='infor1id' and b.name like 'DF%'
- exec('alter table lanmu3 drop constraint '+@name);
- declare @name varchar(100)
- select @name=b.name from syscolumns a,sysobjects b where a.id=object_id('lanmu3') and b.id=a.cdefault and a.name='infor2id' and b.name like 'DF%'
- exec('alter table lanmu3 drop constraint '+@name);
- declare @name varchar(100)
- select @name=b.name from syscolumns a,sysobjects b where a.id=object_id('product') and b.id=a.cdefault and a.name='prod1id' and b.name like 'DF%'
- exec('alter table product drop constraint '+@name);
- declare @name varchar(100)
- select @name=b.name from syscolumns a,sysobjects b where a.id=object_id('product') and b.id=a.cdefault and a.name='prod2id' and b.name like 'DF%'
- exec('alter table product drop constraint '+@name);
- declare @name varchar(100)
- select @name=b.name from syscolumns a,sysobjects b where a.id=object_id('information') and b.id=a.cdefault and a.name='infor1id' and b.name like 'DF%'
- exec('alter table information drop constraint '+@name);
- declare @name varchar(100)
- select @name=b.name from syscolumns a,sysobjects b where a.id=object_id('information') and b.id=a.cdefault and a.name='infor2id' and b.name like 'DF%'
- exec('alter table information drop constraint '+@name);
- declare @name varchar(100)
- select @name=b.name from syscolumns a,sysobjects b where a.id=object_id('information') and b.id=a.cdefault and a.name='click' and b.name like 'DF%'
- exec('alter table information drop constraint '+@name);
- alter table lanmu3 add constraint defaultname default 0 for prod_order;
- create Table collection(id int identity(1,1) primary key,c_name nvarchar(50),c_table varchar(50),c_tablename nvarchar(50),c_encode varchar(50),c_order int default 0,c_url varchar(250),c_url_startpage int default 1,c_url_endpage int default 1,c_urls text,c_list_starthtml ntext,c_list_endhtml ntext,c_list_domain varchar(250),c_list_urlcontains varchar(200),c_list_urlnotcontains varchar(200),c_saveimage int default 1,xuhao int default 0,thedate datetime);
- create Table zdymodel(id int identity(1,1) primary key,planguage varchar(50),name nvarchar(50),f_id int default 0,f_table varchar(50),nav_head_model ntext,nav_list_model ntext,nav_bottom_model ntext,template_head_model ntext,template_list_model ntext,template_bottom_model ntext,lanmu_head_model ntext,lanmu_list_model ntext,lanmu_bottom_model ntext,detail_head_model ntext,detail_model ntext,detail_bottom_model ntext,search_head_model ntext,search_list_model ntext,search_bottom_model ntext,xuhao int default 0);
- create Table zdyform_sort(id int identity(1,1) primary key,planguage varchar(50),fid int default 0,ftable varchar(50),parent_id int default 0,sort_level int default 1,sort_name nvarchar(50),allow_memtype varchar(250),xuhao int default 0);
- alter table lanmu1 alter column target varchar(50);
- alter table lanmu2 alter column target varchar(50);
- alter table lanmu3 alter column target varchar(50);
- alter table template alter column target nvarchar(50);
- alter table zdyform_field add search int default 0,collection int default 0,fckeditor int default 0,field_js ntext;
- alter table lanmu2 add zdymodel_id int default 0,zdymodel_table varchar(50),sort1id int default 0,sort2id int default 0,zdymodel_order varchar(50),zdymodel_condition varchar(50);
- alter table template add zdymodel_id int default 0,zdymodel_table varchar(50),sort1id int default 0,sort2id int default 0,zdymodel_order varchar(50),zdymodel_condition varchar(50);
- alter table lanmu3 add lanmu3_target varchar(50),zdymodel_id int default 0,zdymodel_table varchar(50),sort1id int default 0,sort2id int default 0,zdymodel_order varchar(50),zdymodel_condition varchar(50),zdymodel_show_num int default 20;
- alter table network add cprovince nvarchar(50);
- alter table zdyform_field add value_type nvarchar(50);
- alter table product add username varchar(50),show int default 0,list_order int default 0,price_unit nvarchar(50),thumbnail nvarchar(100),sort1id int default 0,sort2id int default 0,sort1 nvarchar(50),sort2 nvarchar(50);
- alter table information add thumbnail nvarchar(100),sort1id int default 0,sort2id int default 0,sort1 nvarchar(50),sort2 nvarchar(50),clicks int default 0;
- alter table prod1 add allow_memtype varchar(200);
- alter table prod2 add allow_memtype varchar(200);
- alter table comments add planguage varchar(50);
- alter table lanmu2 add show_tj int default 0;
- alter table lanmu2 add list_order int default 0;
- alter table template add list_order int default 0;
- alter table template add show_tj int default 0;
- alter table slide add list_order int default 0;
- update lanmu1 set target='_self';
- update lanmu2 set target='_self',zdymodel_id=0,sort1id=0,sort2id=0;
- update lanmu3 set lanmu3_target='_self',target='_self',zdymodel_id=0,sort1id=0,sort2id=0,zdymodel_show_num=20;
- update template set target='_self',zdymodel_id=0,sort1id=0,sort2id=0;
- update template set sort1id=infor1id,sort2id=infor2id where thetype='article';
- update template set sort1id=prod1id,sort2id=prod2id where thetype='product';
- update lanmu2 set sort1id=infor1id,sort2id=infor2id where thetype='article';
- update lanmu2 set sort1id=prod1id,sort2id=prod2id where thetype='product';
- update lanmu3 set sort1id=infor1id,sort2id=infor2id where thetype='article';
- update lanmu3 set sort1id=prod1id,sort2id=prod2id where thetype='product';
- update lanmu3 set prod_order=0 where prod_order is null;
- update zdyform_field set search=0,fckeditor=0;
- update product set list_order=0,show=1,thumbnail=upload,sort1id=prod1id,sort2id=prod2id,sort1=prod1,sort2=prod2;
- update information set thumbnail=upload,sort1id=infor1id,sort2id=infor2id,sort1=infor1,sort2=infor2,clicks=click;
- update comments set planguage='cn' where planguage is null;
- update template set list_order=0;
- update template set show_tj=0 where show_tj is null;
- update lanmu2 set show_tj=0,list_order=0;
- update slide set list_order=0;
- alter table template drop column prod1id;
- alter table template drop column prod2id;
- alter table template drop column infor1id;
- alter table template drop column infor2id;
- alter table lanmu2 drop column prod1id;
- alter table lanmu2 drop column prod2id;
- alter table lanmu2 drop column infor1id;
- alter table lanmu2 drop column infor2id;
- alter table lanmu3 drop column prod1id;
- alter table lanmu3 drop column prod2id;
- alter table lanmu3 drop column infor1id;
- alter table lanmu3 drop column infor2id;
- alter table product drop column prod1id;
- alter table product drop column prod2id;
- alter table product drop column prod1;
- alter table product drop column prod2;
- alter table information drop column click;
- alter table information drop column infor1;
- alter table information drop column infor2;
- alter table information drop column infor1id;
- alter table information drop column infor2id
复制代码
|