IF NOT EXISTS (
  SELECT * 
  FROM   sys.columns 
  WHERE  object_id = OBJECT_ID(N'[AKUZ].[T_HSCHET_ZAP]') 
         AND name = 'SOC2'
)
exec sp_rename 'AKUZ.T_HSCHET_ZAP.SOC', 'SOC2', 'COLUMN'
GO

IF NOT EXISTS (
  SELECT * 
  FROM   sys.columns 
  WHERE  object_id = OBJECT_ID(N'[AKUZ].[T_SCHET_ZAP]') 
         AND name = 'SOC2'
)
exec sp_rename 'AKUZ.T_SCHET_ZAP.SOC', 'SOC2', 'COLUMN'
GO

IF NOT EXISTS (
  SELECT * 
  FROM   sys.columns 
  WHERE  object_id = OBJECT_ID(N'[AKUZ].[T_SCHET_ZAP]') 
         AND name = 'SOC'
)
ALTER TABLE [AKUZ].[T_SCHET_ZAP] ADD [SOC] varchar(3) NULL
GO

IF NOT EXISTS (
  SELECT * 
  FROM   sys.columns 
  WHERE  object_id = OBJECT_ID(N'[AKUZ].[T_HSCHET_ZAP]') 
         AND name = 'SOC'
)
ALTER TABLE [AKUZ].[T_HSCHET_ZAP] ADD [SOC] varchar(3) NULL
GO