C2026-058 Check all Tables for if Acc Page Id Prefix is Used More than Once

This commit is contained in:
mschill committed 2026-10-15 11:27:45 -04:00
1 parent ae9fb0eb67
commit 82f11fa696
10 files changed
+717 -133

No files matched your search

+31 -1
View File
@@ -263,7 +263,7 @@ WITH EXECUTE AS OWNER
AS
SELECT COUNT (RecID)
FROM [ROALL]
WHERE [ROTable]=@ROTable AND AccPageID=@AccPageID
WHERE [ROTable]=@ROTable AND AccPageID=@AccPageID
GO
-- Display the status of Proc creation
IF (@@Error = 0) PRINT 'Procedure Creation: getCountRecidByAccid Succeeded'
@@ -827,4 +827,34 @@ IF (@@Error = 0) PRINT 'Table Creation: ROALL Succeeded'
ELSE PRINT 'Table Creation: DeleteLog ROALL on Creation'
GO
/****** Object: StoredProcedure [dbo].[checkAccPagePrefixUsed] ******/
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[checkAccPagePrefixUsed]') AND OBJECTPROPERTY(id,N'IsProcedure') = 1)
DROP PROCEDURE [checkAccPagePrefixUsed];
GO
/*****************************************************************************
Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE
Copyright 2026 - Volian Enterprises, Inc. All rights reserved.
*****************************************************************************/
CREATE PROCEDURE [dbo].[checkAccPagePrefixUsed]
(
@Prefix char(32),
@ROTable char(8)
)
WITH EXECUTE AS OWNER
AS
SELECT COUNT(*)
FROM
(
SELECT ROTable, cast(info as xml) xinfo
FROM [ROALL]
WHERE Info LIKE '%AccPageIDPrefix%' AND ROTable <> @ROTable
) TBL
cross apply
xinfo.nodes('vlnGroup') t1(r1)
WHERE r1.value('@AccPageIDPrefix','varchar(max)') = @Prefix
GO
-- Display the status of Proc creation
IF (@@Error = 0) PRINT 'Procedure Creation: checkAccPagePrefixUsed Succeeded'
ELSE PRINT 'Procedure Creation: checkAccPagePrefixUsed Error on Creation'
GO