IF OBJECT_ID('[Skole].[DimFag]','U') IS NOT NULL
BEGIN
IF NOT EXISTS (SELECT 'T' FROM [Skole].[DimFag] WHERE [DimFagID] = -1 )
  INSERT INTO [Skole].[DimFag]([DimFagID]) VALUES (-1)
UPDATE [Skole].[DimFag] SET
   [FagKode] = -1
	,[FagTekst] = 'Ukendt'
	,[FagsystemFagKode] = 'Ukendt'
	,[Produktionssystem] = 'Ukendt'
	,[SYS_KommuneId] = 999
   WHERE [DimFagID] = -1
END
GO
