• Can you post the script that you've got after removing the 2000 part out? I tried doing the same and it worked with out any problem.

    try doing it like this (All i am doing here is enclosing the 3 part names in square parentheses):

    FROM [?].[sys].[database_principals] u

    LEFT JOIN ([?].[sys].[database_role_members] m

    JOIN [?].[sys].[database_principals] r

    ON m.role_principal_id = r.principal_id)

    ON m.member_principal_id = u.principal_id

    LEFT JOIN [?].[sys].[server_principals] l

    ON u.sid = l.sid

    Replace the code in the "from"clause with this.

    See if you have any spaces in the name of the database.

    Kindest Regards,
    Shivaram Challa
    (http://challa.net - Home of the "Excel to CSV converter & Browsepad applications".)
    Forum Etiquette: How to post data/code on a forum to get the best help[/url]