-
Notifications
You must be signed in to change notification settings - Fork 0
/
V202408150928__v2.3.x.sql
53 lines (50 loc) · 1.79 KB
/
V202408150928__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
-----------------------------------------------------------------
-- SQL Code Generation
-- Entity: Company Integration Run API Logs
-- Item: spCreateCompanyIntegrationRunAPILog
-- 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 CompanyIntegrationRunAPILog
------------------------------------------------------------
DROP PROCEDURE IF EXISTS [${flyway:defaultSchema}].[spCreateCompanyIntegrationRunAPILog]
GO
CREATE PROCEDURE [${flyway:defaultSchema}].[spCreateCompanyIntegrationRunAPILog]
@CompanyIntegrationRunID uniqueidentifier,
@ExecutedAt datetime,
@IsSuccess bit,
@RequestMethod nvarchar(12),
@URL nvarchar(MAX),
@Parameters nvarchar(MAX)
AS
BEGIN
SET NOCOUNT ON;
DECLARE @InsertedRow TABLE ([ID] UNIQUEIDENTIFIER)
INSERT INTO
[${flyway:defaultSchema}].[CompanyIntegrationRunAPILog]
(
[CompanyIntegrationRunID],
[ExecutedAt],
[IsSuccess],
[RequestMethod],
[URL],
[Parameters]
)
OUTPUT INSERTED.[ID] INTO @InsertedRow
VALUES
(
@CompanyIntegrationRunID,
@ExecutedAt,
@IsSuccess,
@RequestMethod,
@URL,
@Parameters
)
-- return the new record from the base view, which might have some calculated fields
SELECT * FROM [${flyway:defaultSchema}].[vwCompanyIntegrationRunAPILogs] WHERE [ID] = (SELECT [ID] FROM @InsertedRow)
END
GO
GRANT EXECUTE ON [${flyway:defaultSchema}].[spCreateCompanyIntegrationRunAPILog] TO [cdp_Developer], [cdp_Integration]