IF OBJECT_ID('[Skole].[DimInstitution]','U') IS NOT NULL
BEGIN
IF NOT EXISTS (SELECT 'T' FROM [Skole].[DimInstitution] WHERE [DimInstitutionID] = -1 )
  INSERT INTO [Skole].[DimInstitution]([DimInstitutionID]) VALUES (-1)
UPDATE [Skole].[DimInstitution] SET
   [Institutionsnummer] = -1
	,[HovedskoleInstitutionsnummer] = -1
	,[Institutionsnavn] = 'Ukendt'
	,[Ejerkode] = 9999
	,[KommunenummerSkoleejer] = 9999
	,[KommunenummerBeliggenhed] = 9999
	,[InstitutionstypeID] = -1
	,[Produktionssystem] = 'Ukendt'
	,[SYS_KommuneId] = 999
   WHERE [DimInstitutionID] = -1
END
GO
