Declare @Id Int                               
Select @Id = Id From sysobjects Where Name = 'TblDrugUse'
if  Exists(SELECT * FROM syscolumns WHERE id = @Id and Name = 'Use_Code')
begin
  ALTER TABLE TblDrugUse DROP CONSTRAINT PK_TblUseDrug
  Alter table TblDrugUse alter column Use_Code varchar(6) not null
  ALTER TABLE TblDrugUse ADD CONSTRAINT PK_TblUseDrug PRIMARY KEY (Use_Code)

end
                            
Select @Id = Id From sysobjects Where Name = 'TblUseMind'
if  Exists(SELECT * FROM syscolumns WHERE id = @Id and Name = 'Use_Code')
  Alter table TblUseMind alter column Use_Code varchar(6) null
                            
Select @Id = Id From sysobjects Where Name = 'TblUMDrugHavaleh'
if  Exists(SELECT * FROM syscolumns WHERE id = @Id and Name = 'Use_Code')
  Alter table TblUMDrugHavaleh alter column Use_Code varchar(6) null

Select @Id = Id From sysobjects Where Name = 'TblDrugUse'
if  Exists(SELECT * FROM syscolumns WHERE id = @Id and Name = 'Use_Name')
  Alter table TblDrugUse alter column Use_Name nvarchar(200)  null


Select @Id = Id From sysobjects Where Name = 'TblDrugUse'
if  Exists(SELECT * FROM syscolumns WHERE id = @Id and Name = 'Use_Name')
  Alter table TblDrugUse alter column Use_Name nvarchar(200)  null

 
  
  
  
  
