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