IF OBJECT_ID('[Ydelsesrefusion].[DimGenoptjening]','U') IS NOT NULL
BEGIN
IF NOT EXISTS (SELECT 'T' FROM [Ydelsesrefusion].[DimGenoptjening] WHERE [DimGenoptjeningID] = -1 )
  INSERT INTO [Ydelsesrefusion].[DimGenoptjening]([DimGenoptjeningID]) VALUES (-1)
UPDATE [Ydelsesrefusion].[DimGenoptjening] SET
   [SYS_KommuneId] = 999
   WHERE [DimGenoptjeningID] = -1
END
GO
