Find out database Permissions for my Windows Login in SQL 2005

  • Hi,

    I am currently logged into the SQL Server 2005 (Integrated Windows Authentication) via the SQL 2005 Management Studio. I would like to find out what is the command using which I can find out what Role / permissions have been granted to my Windows NT login.

    I want to find it out through SQL Query commands (programmatically) and not via GUI like expanding the Security Section, expanding Logins, expanding the Server Roles section etc.

    Thanks in Advance

  • These might help...

    http://www.sql-server-performance.com/articles/dba/object_permission_scripts_p1.aspx

    and a quick one for per-instance-check:

    USE master;

    SELECT *

    FROM fn_my_permissions(NULL, 'SERVER');

    GO

    and another for per DB check:

    USE master;

    SELECT *

    FROM fn_my_permissions('master', 'DATABASE');

    GO

    -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    This thing is addressing problems that dont exist. Its solution-ism at its worst. We are dumbing down machines that are inherently superior. - Gilfoyle

  • When I try to execute the query

    USE master;

    SELECT *

    FROM fn_my_permissions(NULL, 'SERVER');

    GO

    I get the error message

    Invalid object name 'fn_my_permissions'.

  • You are running SQL Server 2005?

    -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    This thing is addressing problems that dont exist. Its solution-ism at its worst. We are dumbing down machines that are inherently superior. - Gilfoyle

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply