Summary Table
Categories |
Total Count |
PII |
0 |
URL |
0 |
DNS |
0 |
EKL |
0 |
IP |
0 |
PORT |
0 |
VsID |
0 |
CF |
0 |
AI |
0 |
VPD |
0 |
PL |
0 |
Other |
0 |
File Content
?-- =============================================
-- Description: Record to the synchronization logs table raw records were massaged into relational db
--
-- Maintenance Log:
--
-- Update By Update Date Description
-- ----------- --------- ----------------------------
-- =============================================
CREATE PROCEDURE dbo.uspSetSyncLogs
@tableName varchar(50), --note that this will need to include the schema name, if not dbo
@batchLogId bigint
AS
BEGIN
DECLARE @nDynamicSQL nvarchar(max);
DECLARE @nParameter_Definition nvarchar(max);
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
BEGIN TRY
--insert into the logs
--record number wait list records inserted
--must pass in the schema name as part of the @tableName (e.g., dbo, dim, etc.)
SET @nDynamicSQL = N'INSERT INTO SyncLogs (BatchLogID, TableName, DateSynchronized, SyncRecordCount)' +
' SELECT BatchLogID, ''' + @tableName + ''', GETDATE(), COUNT(1)' +
' FROM ' + @tableName +
' GROUP BY BatchLogID' +
' HAVING BatchLogID = ' + CAST(@batchLogId AS varchar);
EXEC sp_executesql @nDynamicSQL;
END TRY
BEGIN CATCH
PRINT 'There was an error logging relational data synch results' + CHAR(13);
THROW;
END CATCH
END
GO