-
Notifications
You must be signed in to change notification settings - Fork 0
/
V202408150929__v2.3.x.sql
59 lines (56 loc) · 1.82 KB
/
V202408150929__v2.3.x.sql
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
56
57
58
59
-----------------------------------------------------------------
-- SQL Code Generation
-- Entity: Error Logs
-- Item: spCreateErrorLog
-- Generated: 8/15/2024, 9:14:48 PM
--
-- This was generated by the MemberJunction CodeGen tool.
-- This file should NOT be edited by hand.
-----------------------------------------------------------------
------------------------------------------------------------
----- CREATE PROCEDURE FOR ErrorLog
------------------------------------------------------------
DROP PROCEDURE IF EXISTS [${flyway:defaultSchema}].[spCreateErrorLog]
GO
CREATE PROCEDURE [${flyway:defaultSchema}].[spCreateErrorLog]
@CompanyIntegrationRunID uniqueidentifier,
@CompanyIntegrationRunDetailID uniqueidentifier,
@Code nchar(20),
@Message nvarchar(MAX),
@CreatedBy nvarchar(50),
@Status nvarchar(10),
@Category nvarchar(20),
@Details nvarchar(MAX)
AS
BEGIN
SET NOCOUNT ON;
DECLARE @InsertedRow TABLE ([ID] UNIQUEIDENTIFIER)
INSERT INTO
[${flyway:defaultSchema}].[ErrorLog]
(
[CompanyIntegrationRunID],
[CompanyIntegrationRunDetailID],
[Code],
[Message],
[CreatedBy],
[Status],
[Category],
[Details]
)
OUTPUT INSERTED.[ID] INTO @InsertedRow
VALUES
(
@CompanyIntegrationRunID,
@CompanyIntegrationRunDetailID,
@Code,
@Message,
@CreatedBy,
@Status,
@Category,
@Details
)
-- return the new record from the base view, which might have some calculated fields
SELECT * FROM [${flyway:defaultSchema}].[vwErrorLogs] WHERE [ID] = (SELECT [ID] FROM @InsertedRow)
END
GO
GRANT EXECUTE ON [${flyway:defaultSchema}].[spCreateErrorLog] TO [cdp_Integration], [cdp_Developer]