1 / 2

debug.ReplaceObjectIdentifier

debug.ReplaceObjectIdentifier. CREATE PROCEDURE [debug].[ ReplaceObjectIdentifier ] @ currentIdentifier UNIQUEIDENTIFIER, @ newIdentifier UNIQUEIDENTIFIER AS BEGIN DECLARE @ placeholderIdentifier UNIQUEIDENTIFIER; DECLARE @ identifierExists INT; IF NOT EXISTS (

lindsey
Download Presentation

debug.ReplaceObjectIdentifier

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. debug.ReplaceObjectIdentifier CREATE PROCEDURE [debug].[ReplaceObjectIdentifier] @currentIdentifier UNIQUEIDENTIFIER, @newIdentifier UNIQUEIDENTIFIER AS BEGIN DECLARE @placeholderIdentifier UNIQUEIDENTIFIER; DECLARE @identifierExists INT; IF NOT EXISTS ( SELECT 1 FROM [fim].[Objects] AS [o] WHERE [o].[ObjectID] = @currentIdentifier AND [o].[ObjectTypeKey] = [fim].[ObjectTypeKeyFromName]('ObjectVisualizationConfiguration') ) BEGIN RAISERROR ('Cannot find the RCDC object with the provided current identifier', 0, 0); RETURN; END

  2. debug.ReplaceObjectIdentifier (cont) SET @placeholderIdentifier = NEWID(); BEGIN TRANSACTION; UPDATE [fim].[ObjectValueIdentifier] SET [ValueIdentifier] = @placeholderIdentifier WHERE [ValueIdentifier] = @newIdentifier; UPDATE [fim].[Objects] SET [ObjectID] = @placeholderIdentifier WHERE [ObjectID] = @newIdentifier; UPDATE [fim].[ObjectValueIdentifier] SET [ValueIdentifier] = @newIdentifier WHERE [ValueIdentifier] = @currentIdentifier; UPDATE [fim].[Objects] SET [ObjectID] = @newIdentifier WHERE [ObjectID] = @currentIdentifier; COMMIT TRANSACTION; END

More Related