IF NOT EXISTS(SELECT * FROM sys.columns WHERE object_id = OBJECT_ID(N'[dbo].[CSAPP_PROTOCOL_TYPES_REL_MAIL]')
AND name = 'PK')
BEGIN
alter table CSAPP_PROTOCOL_TYPES_REL_MAIL drop column PK
alter table CSAPP_PROTOCOL_TYPES_REL_MAIL add PK int primary key identity(1,1) not null
END

IF NOT EXISTS(SELECT * FROM sys.columns WHERE object_id = OBJECT_ID(N'[dbo].[kunden]')
AND name = 'CSAPP_KUNDENCODE')
alter table kunden add CSAPP_KUNDENCODE int NULL
IF NOT EXISTS(SELECT * FROM sys.columns WHERE object_id = OBJECT_ID(N'[dbo].[kunden]')
AND name = 'CSAPP_SEPA')
alter table kunden add CSAPP_SEPA bit NULL
IF NOT EXISTS(SELECT * FROM sys.columns WHERE object_id = OBJECT_ID(N'[dbo].[kunden]')
AND name = 'CSAPP_DSGVO')
alter table kunden add  CSAPP_DSGVO bit NULL