declare @tmp varchar(20)
select @tmp=name from sysobjects where name like 'pk__dwbmb%'
exec('alter table dwbmb drop constraint '+@tmp)
alter table dwbmb alter column dwmc varchar(60) not null
go
alter table dwbmb add constraint pk_dwbmb_dwmc primary key(dwmc)
drop index [dwbmb].[idwbmb]
create unique index idwbmb on dwbmb(dwmc,jc_xzbh,jc_dqbh,jc_zxbh,jc_yzbh)
alter column dwmc varchar(60) not null
go
alter table dwbmb
add constraint pk_dwbmb primary key(dwmc)
go
drop index dwbmb.idwbmb
go
create unique index idwbmb on dwbmb(jc_xzbh,dwmc,jc_dqbh,jc_zxbh,jc_yzbh)