April 2, 2009 at 9:56 am
What am I doing wrong here?
I'm executing this:
execute ('select * From fn_my_permissions(NULL, 'database')') AS USER = 'firstuser'
and am receiving this error:
Msg 102, Level 15, State 1, Line 1
Incorrect syntax near 'SERVER'.
Thanks for any hlep!
April 2, 2009 at 10:06 am
You have add two single quotes within a string in order to read it as a part of the string. For e.g.
EXECUTE ('select * From fn_my_permissions(NULL, ''database'')') AS USER = 'firstuser'
--Ramesh
April 2, 2009 at 10:17 am
thanks ramesh
another question:
when i execute:
execute ('select * From fn_my_permissions(NULL, ''SERVER'')') AS USER = 'firstuser'
REVERT
i get no rows returned; however, when i execute:
EXECUTE AS LOGIN = 'firstuser'
GO
SELECT *
FROM fn_my_permissions(NULL, 'SERVER');
REVERT;
GO
i get back rows. What's the difference between the two statements?????
April 2, 2009 at 10:19 am
I got it... one has LOGIN, the other USER.
thanks
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply