if(exists (select * from sys.all_columns c 
						join sys.tables t on t.object_id = c.object_id
						where c.name = 'HasTextContent' and t.name = 'T_RDS_SYNCHRONISATION_ERRORS'))
begin
ALTER TABLE APS.T_RDS_SYNCHRONISATION_ERRORS DROP COLUMN [HasTextContent]
end
if(not exists (select * from sys.all_columns c 
						join sys.tables t on t.object_id = c.object_id
						where c.name = 'HasByteContent' and t.name = 'T_RDS_SYNCHRONISATION_ERRORS'))
begin
ALTER TABLE APS.T_RDS_SYNCHRONISATION_ERRORS ADD [HasByteContent]  AS (CONVERT([bit],case when [ByteContent] IS NOT NULL then (1) else (0) end,(0)))
end

