OFFXPDEV: Cannot Use Row Permissions on a Table That Has a BigInt Primary Key (290265)
The information in this article applies to:
- Microsoft Office XP Developer
This article was previously published under Q290265 SYMPTOMS
When you try to add row based permissions to a Workflow table, you receive the following error message:
Row based permissions cannot be enabled for Table <Table Name>. <Table Name> must have a single column Primary Key or Identity column compatible with the integer datatype.
CAUSE
The Workflow table has a primary key with the BigInt data type. The Workflow Designer does not support the BigInt data type.
RESOLUTION
To use the BigInt data type as the primary key field, you must make the following two changes:
- Modify the modCheckNumericDatatypeCompat stored procedure to the following:
CREATE PROCEDURE [dbo].modCheckNumericDatatypeCompat
@ColTypeCompatWITH sysname, --The name of the col to be compatible WITH
@ColTypeChecking sysname, --The column you're checking!
@ColTypeCompatWITHPrec smallint,
@ColTypeCompatWITHScale smallint,
@ColTypeCheckingPrec smallint,
@ColTypeCheckingScale smallint,
@Compat bit OUTPUT
AS
SET NOCOUNT ON
IF (@ColTypeChecking IN ('int', 'smallint', 'tinyint', 'numeric', 'decimal', 'bigint') AND
-- One of the folling MUST be true!
((@ColTypeChecking IN ('bigint', 'int', 'smallint', 'tinyint') AND (@ColTypeChecking = @ColTypeCompatWITH))
OR (@ColTypeCompatWITH = 'bigint' AND @ColTypeChecking IN ('int','smallint', 'tinyint', 'numeric', 'decimal'))
OR (@ColTypeCompatWITH = 'int' AND @ColTypeChecking IN ('smallint', 'tinyint', 'numeric', 'decimal'))
OR (@ColTypeCompatWITH = 'smallint' AND @ColTypeChecking = 'tinyint')
OR (@ColTypeCompatWITH IN ('numeric', 'decimal')
AND @ColTypeCompatWITHPrec >= @ColTypeCheckingPrec AND @ColTypeCompatWITHScale = 0 AND @ColTypeCheckingScale = 0)))
SET @Compat = 1 --Yes these numeric datatypes are compatible.
ELSE
SET @Compat = 0 --NO - these numeric datatypes are NOT compatible.
GO
- Change the RowID column data type from int to BigInt in the modPermissions table.
After you have made these two changes, you can add row permissions to the Workflow table.
NOTE: The modCheckNumericDatatypeCompat stored procedure and modPermissions table reside in the Workflow database.
Modification Type: | Major | Last Reviewed: | 10/30/2001 |
---|
Keywords: | kbbug kberrmsg KB290265 |
---|
|