Documente Academic
Documente Profesional
Documente Cultură
GO
/****** Object: StoredProcedure [interim].[usp_write_log_data_download] Script
Date: 18/11/2016 16:32:20 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
AS
/
***********************************************************************************
*************************************************
* Name : [usp_write_log]
* Purpose : This procedure is for creating detailed log entries.
* Method :
* Input Params :
* @db_load_job_id : The Log ID for which the
master log entry is being created.
* @package_name : The Package Name for
which the detailed log entry is being created.
* @task_name : The Task Name for which
the detailed log entry is being created.
* @message_type_key : A single characted denoting
the type of message.
* 'C' - Completion
* 'E' - Error
* @log_message : The messaged to be
logged.
*
*
* Versions : No Author Date Comments
* : -- ------ ---- --------
* : 0 Thass\Sridharan 13-Nov-2013
Original version.
***********************************************************************************
*************************************************/
BEGIN
DECLARE @step SMALLINT -- Identifies the
step in the stored procedure.
DECLARE @msg VARCHAR(2000) -- The message that
is logged.
DECLARE @err_desc VARCHAR(1000) -- The system generated
error message which is logged.
DECLARE @err_code INT -- The system
generated error number which is logged.
DECLARE @err_state INT -- The system
generated error state which is logged.
BEGIN TRY
-- Initialise variables
SET @msg = ''
SET @err_desc = NULL
SET @step = 0
RAISERROR(@msg, 16, 1)
RETURN 0
END
END TRY
BEGIN CATCH
SET @msg = 'Error while performing: ' + @Msg + ' at Step Number : ' +
CAST(@step AS VARCHAR(2))
SET @err_desc = ERROR_MESSAGE()
SET @err_code = ERROR_SEVERITY()
SET @err_state = ERROR_STATE()
RAISERROR(@msg,@err_code,@err_state)
END CATCH
END