HI All,
I have an application vendor trying to run the following code:
exec sp_executesql N'
DECLARE @SrvRequiredPermissions table (permName nvarchar(256))
DECLARE @ExistPermissions table (permName nvarchar(256))
INSERT INTO @SrvRequiredPermissions (permName) VALUES (N''CONNECT SQL'')
INSERT INTO @SrvRequiredPermissions (permName) VALUES (N''CREATE ANY DATABASE'')
INSERT INTO @SrvRequiredPermissions (permName) VALUES (N''VIEW ANY DATABASE'')
INSERT INTO @SrvRequiredPermissions (permName) VALUES (N''ALTER ANY LOGIN'')
INSERT INTO @SrvRequiredPermissions (permName) VALUES (N''ALTER ANY DATABASE'')
INSERT INTO @SrvRequiredPermissions (permName) VALUES (N''CONTROL SERVER'')
INSERT INTO @ExistPermissions (permName)
SELECT permission_name
FROM fn_my_permissions (NULL, ''SERVER'')
IF EXISTS(
SELECT permName
FROM @SrvRequiredPermissions reqPerm
WHERE reqPerm.permName NOT IN (SELECT * FROM @ExistPermissions))
BEGIN
RAISERROR(N''Provided account does not have enough permissions to continue installation.'', 11, -1, N'''')
END
'
with th efollowing results
(1 row(s) affected)
(1 row(s) affected)
(1 row(s) affected)
(1 row(s) affected)
(1 row(s) affected)
(1 row(s) affected)
(0 row(s) affected)
Msg 50000, Level 11, State 1, Line 22
Provided account does not have enough permissions to continue installation.
They are using the SA account (customer decision) and are running it from a remote server.
I have tried running the sql on a seperate test server and it runs fine, all credentials seem to be the same so i am lost as to why the sql is not running successfully.
Any help would be much appreciated.
Thanks in advance.
I have an application vendor trying to run the following code:
exec sp_executesql N'
DECLARE @SrvRequiredPermissions table (permName nvarchar(256))
DECLARE @ExistPermissions table (permName nvarchar(256))
INSERT INTO @SrvRequiredPermissions (permName) VALUES (N''CONNECT SQL'')
INSERT INTO @SrvRequiredPermissions (permName) VALUES (N''CREATE ANY DATABASE'')
INSERT INTO @SrvRequiredPermissions (permName) VALUES (N''VIEW ANY DATABASE'')
INSERT INTO @SrvRequiredPermissions (permName) VALUES (N''ALTER ANY LOGIN'')
INSERT INTO @SrvRequiredPermissions (permName) VALUES (N''ALTER ANY DATABASE'')
INSERT INTO @SrvRequiredPermissions (permName) VALUES (N''CONTROL SERVER'')
INSERT INTO @ExistPermissions (permName)
SELECT permission_name
FROM fn_my_permissions (NULL, ''SERVER'')
IF EXISTS(
SELECT permName
FROM @SrvRequiredPermissions reqPerm
WHERE reqPerm.permName NOT IN (SELECT * FROM @ExistPermissions))
BEGIN
RAISERROR(N''Provided account does not have enough permissions to continue installation.'', 11, -1, N'''')
END
'
with th efollowing results
(1 row(s) affected)
(1 row(s) affected)
(1 row(s) affected)
(1 row(s) affected)
(1 row(s) affected)
(1 row(s) affected)
(0 row(s) affected)
Msg 50000, Level 11, State 1, Line 22
Provided account does not have enough permissions to continue installation.
They are using the SA account (customer decision) and are running it from a remote server.
I have tried running the sql on a seperate test server and it runs fine, all credentials seem to be the same so i am lost as to why the sql is not running successfully.
Any help would be much appreciated.
Thanks in advance.