--V1.8.3Ëù×÷Éý¼¶
if exists( Select OptValue from tSysOpt where OptName='DBEdition')
begin
  Declare @DBVer varchar(10)
  Select @DBVer=OptValue from tSysOpt where OptName='DBEdition'
  Set @DBVer=Substring(@DBVer,1,4)+'-'+Substring(@DBVer,6,2)+'-'+Substring(@DBVer,9,2)
  if @DBVer>='2008-01-08'
    Return
end



if not Exists(Select * from SysColumns where Id=Object_ID('FWXHH') and name='DeliveryMan' )
begin
  alter table FWXHH add 
	[DeliveryMan]  Varchar(6)  not null default ('') with values
end

if not Exists(Select * from SysColumns where Id=Object_ID('FWDHH') and name='DeliveryMan' )
begin
  alter table FWDHH add 
	[DeliveryMan]  Varchar(6)  not null default ('') with values
end

if not Exists(Select * from SysColumns where Id=Object_ID('FWDHH_history') and name='DeliveryMan' )
begin
  alter table FWDHH_history add 
	[DeliveryMan]  Varchar(6)  not null default ('') with values
end

if not Exists(Select * from SysColumns where Id=Object_ID('FWTHH') and name='DeliveryMan' )
begin
  alter table FWTHH add 
	[DeliveryMan]  Varchar(6)  not null default ('') with values
end

---------------

if not Exists(Select * from SysColumns where Id=Object_ID('FWXHH') and name='Consignor' )
begin
  alter table FWXHH add 
	[Consignor]  Varchar(6)  not null default ('') with values
end

if not Exists(Select * from SysColumns where Id=Object_ID('FWDHH') and name='Consignor' )
begin
  alter table FWDHH add 
	[Consignor]  Varchar(6)  not null default ('') with values
end

if not Exists(Select * from SysColumns where Id=Object_ID('FWDHH_history') and name='Consignor' )
begin
  alter table FWDHH_history add 
	[Consignor]  Varchar(6)  not null default ('') with values
end

if not Exists(Select * from SysColumns where Id=Object_ID('FWTHH') and name='Consignor' )
begin
  alter table FWTHH add 
	[Consignor]  Varchar(6)  not null default ('') with values
end