A function like "IS_MEMBER" ?

  • I am looking for a function like is_member but with an extra parameter ... something like:

    select is_member('user_name','role')

    where you can explicitly find out if a particular user is a member of a role instead of the current user.

    Is there anything like it in SQL Server or will I have to create a UDF of my own (thought I'd ask first so I don't waste time)?

    Thanks

    Jim

  • This was removed by the editor as SPAM

  • I think you'll have to do your own. It looks like the DMO IsMember version might be more flexible, but that wont help in a select.

    Andy

    http://qa.sqlservercentral.com/columnists/awarren/

  • Don't know about functions (I'm on SQL7) but I suppose you could write a function to return a result of lookup for username in master..syslogins and check sysadmin, securityadmin, serveradmin, setupadmin, processadmin, diskadmin and dbcreator with a case statement or database sysusers where roles is a bitmask for db_owner, db_accessadmin, db_securityadmin, db_ddladmin, db_backupoperat, db_datareader, db_datawriter, db_denydataread, db_denydatawrit

    Far away is close at hand in the images of elsewhere.
    Anon.

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

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