Can anyone please confirm if the below SQL procedure is good. We are getting the below error when we call this SQL procedure from SAS MDM Dataflux job. 2019-07-31T08:57:47,916 ERROR [ROOT][53A9AEFD4BDBEE9E_JOB_7_0][539E8D0EF9C1EC5D_JOB_13_0][DATAFLOW_10_0]Node DATAFLOW_10 error: [1:EXPRESSION:Start Process Control] Expression Plugin - [25000] [DataFlux][ODBC SQL Server Wire Protocol driver][Microsoft SQL Server]The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION. (3903);[25000] [DataFlux][ODBC SQL Server Wire Protocol driver][Microsoft SQL Server]The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION. Below is the stored procedures, when i checked the syntax of these, i dont see any issue, could you please check it for me? USE [SASMDM]; GO SET ANSI_NULLS ON; GO SET QUOTED_IDENTIFIER ON; GO CREATE PROCEDURE [sasmdm].[mdm_start_process_control] ( @parm_staging_id INT, @parm_entity_type_id INT, @parm_src_sys_id INT, @parm_process_name VARCHAR(50), @parm_process_type VARCHAR(50), @parm_user NVARCHAR(513) ) AS BEGIN SET NOCOUNT ON DECLARE @process_id INT EXEC @process_id=[mdm_start_process_control_next] @parm_staging_id,@parm_entity_type_id,@parm_src_sys_id,@parm_process_name,@parm_process_type,@parm_user select @process_id as process_id END GO -------------- USE [SASMDM]; GO SET ANSI_NULLS ON; GO SET QUOTED_IDENTIFIER ON; GO CREATE PROCEDURE [sasmdm].[mdm_start_process_control_next] ( @parm_staging_id INT, @parm_entity_type_id INT, @parm_src_sys_id INT, @parm_process_name VARCHAR(50), @parm_process_type VARCHAR(50), @parm_user NVARCHAR(513) ) AS DECLARE @timestamp datetime; DECLARE @process_id INT; SET NOCOUNT ON BEGIN TRY SELECT @timestamp = GETDATE() BEGIN TRAN INSERT INTO [MDM_PROCESS_CONTROL] ( mdm_staging_id, mdm_entity_type_id, mdm_src_sys_id, process_name, process_type, process_running, process_user, process_start_dttm) VALUES (@parm_staging_id, @parm_entity_type_id, @parm_src_sys_id, @parm_process_name, @parm_process_type, 'Y', @parm_user, @timestamp) COMMIT TRAN SELECT @process_id = process_id FROM mdm_process_control WHERE process_name = @parm_process_name AND mdm_entity_type_id = @parm_entity_type_id AND mdm_staging_id = @parm_staging_id AND mdm_src_sys_id = @parm_src_sys_id AND process_running = 'Y' AND process_start_dttm = @timestamp; RETURN @process_id END TRY BEGIN CATCH ROLLBACK TRAN DECLARE @error_messages VARCHAR(2000) DECLARE @errorSeverity INT DECLARE @errorState INT DECLARE @errorStatus INT DECLARE @errorProc VARCHAR(150) DECLARE @errorDate DATETIME DECLARE @mdm_error_status VARCHAR(10) DECLARE @mdm_error_messages VARCHAR(4000) DECLARE @errorSeverityString VARCHAR(100) DECLARE @errorStateString VARCHAR(100) SELECT @errorStatus = ERROR_NUMBER() SELECT @error_messages = ERROR_MESSAGE() SELECT @errorSeverity = ERROR_SEVERITY() SELECT @errorState = ERROR_STATE() SELECT @errorProc = ERROR_PROCEDURE() SELECT @errorDate = getDate() SELECT @errorSeverityString = CONVERT(VARCHAR,@errorSeverity) SELECT @errorStateString = CONVERT(VARCHAR,@errorState) SELECT @mdm_error_status = CONVERT(VARCHAR,@errorStatus) SELECT @mdm_error_messages = @errorProc+ ' : '+@error_messages+ ' : '+@errorSeverityString+ ' : '+@mdm_error_status+ ' : '+@errorStateString -- Log Error EXEC [mdm_log_error] 'MDM_PROCESS_CONTROL',null,0,null,'mdm_start_process_control_next',@mdm_error_status,@mdm_error_messages,@errorDate -- Raise Error RAISERROR(@error_messages, @errorSeverity, @errorState) END CATCH GO
... View more