-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRTM.AddEvent.StoredProcedure.sql
More file actions
55 lines (33 loc) · 2.98 KB
/
RTM.AddEvent.StoredProcedure.sql
File metadata and controls
55 lines (33 loc) · 2.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/****************************************************************************************************
Developed by DataView, LLC. All rights reserved.
Licensed under GNU LESSER GENERAL PUBLIC LICENSE Version 3
Real Time Messenging Software for SQL Server
***************************************************************************************************/
CREATE PROCEDURE [RTM].[AddEvent]
(
@Level NVARCHAR(50) = 'INFO',
@Source NVARCHAR(4000) = NULL,
@Details NVARCHAR(4000) = NULL,
@IntResult INT = NULL,
@SessionId VARCHAR(255) = NULL,
@Message_Body XML = NULL
)
AS
BEGIN
INSERT INTO rtm.sysEvent (Level, Source, Details, IntResult, SessionId, [Message_body])
SELECT @Level, @Source, @Details, @IntResult, CAST(@SessionId AS UNIQUEIDENTIFIER), @Message_Body
--IF (dbo.IsDebugEnabled() > 0)
-- EXEC dbo.AddDebugEvent @Source, @Details, @IntResult, @SessionId
--IF (@Level = 'ERROR' AND dbo.IsDebugEnabled() > 0)
--BEGIN
-- DECLARE @HTMLSource nvarchar(MAX)
-- SET @HTMLSource = '<BR/>Error Recorded at: ' + CAST(GETDATE() AS varchar(20)) +
-- '<table border="1">' +
-- '<tr bgcolor=#C0C0C0><th>Source</th><th>Error</th><th>Error #</th><th>Session Id</th></tr><tr><td>' +
-- @Source + '</td><td>' + @Details + '</td><td>' + CAST(@IntResult AS varchar(255)) + '</td><td>' + @SessionID +
-- '</td></tr>' +
-- '</table>'
-- EXECUTE [dbo].[SendEmail] 'Budget Template Upload Error', @HTMLSource
--END
END
GO