IF OBJECT_ID('[Skole].[DimElevtype]','U') IS NOT NULL
BEGIN
IF NOT EXISTS (SELECT 'T' FROM [Skole].[DimElevtype] WHERE [DimElevtypeID] = -1 )
  INSERT INTO [Skole].[DimElevtype]([DimElevtypeID]) VALUES (-1)
UPDATE [Skole].[DimElevtype] SET
   [ElevtypeKode] = -1
	,[ElevtypeTekst] = 'Ukendt'
	,[FagsystemElevtypeKode] = 'Ukendt'
	,[FagsystemElevtypeTekst] = 'Ukendt'
	,[Produktionssystem] = 'Ukendt'
	,[SYS_KommuneId] = 999
   WHERE [DimElevtypeID] = -1
END
GO
