This commit is contained in:
skidoodle 2024-03-13 00:33:46 +01:00
commit e124a47765
19374 changed files with 9806149 additions and 0 deletions

View file

@ -0,0 +1,35 @@
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE OR ALTER PROCEDURE auditlog.uspLogError
@ErrorLogID int = 0 OUTPUT -- contains the ErrorLogID of the row inserted
AS -- by uspLogError in the ErrorLog table
DECLARE
@error_number INT = ERROR_NUMBER(),
@error_severity INT = ERROR_SEVERITY(),
@error_state INT = ERROR_STATE(),
@error_procedure SYSNAME = ERROR_PROCEDURE(),
@error_line INT = ERROR_LINE(),
@error_message NVARCHAR(4000) = ERROR_MESSAGE();
SET NOCOUNT ON;
INSERT auditlog.ErrorLog (
UserName,
ErrorNumber,
ErrorSeverity,
ErrorState,
ErrorProcedure,
ErrorLine,
ErrorMessage
) VALUES (
CURRENT_USER,
@error_number,
@error_severity,
@error_state,
@error_procedure,
@error_line,
@error_message
);
SET @ErrorLogID = SCOPE_IDENTITY();
GO