J
JEM
Hello. I am trying to create a stored procedure to call from VBA code
to find out what role a user is a member of which will then trigger
other events. What system table do I find the text name of the role
in? I have started the following, which I snipped from another post,
but it isn't quite working...
CREATE PROCEDURE spCustomFindRole
(
@RoleName sysname
)
AS
BEGIN
DECLARE @RetVal Integer
IF IS_MEMBER(@RoleName) = "Admin"
SET @RetVal = 1
ELSE IF IS_MEMBER(@RoleName) = "Board"
SET @RetVal = 2
ELSE IF IS_MEMBER(@RoleName) = "Development"
SET @RetVal = 3
ELSE IF IS_MEMBER(@RoleName) = "Program"
SET @RetVal = 4
ELSE
SET @RetVal = 5
RETURN @RetVal
END
to find out what role a user is a member of which will then trigger
other events. What system table do I find the text name of the role
in? I have started the following, which I snipped from another post,
but it isn't quite working...
CREATE PROCEDURE spCustomFindRole
(
@RoleName sysname
)
AS
BEGIN
DECLARE @RetVal Integer
IF IS_MEMBER(@RoleName) = "Admin"
SET @RetVal = 1
ELSE IF IS_MEMBER(@RoleName) = "Board"
SET @RetVal = 2
ELSE IF IS_MEMBER(@RoleName) = "Development"
SET @RetVal = 3
ELSE IF IS_MEMBER(@RoleName) = "Program"
SET @RetVal = 4
ELSE
SET @RetVal = 5
RETURN @RetVal
END