SQL SP to validate logins

  • Hi, I am trying to write a sql script that will basically test logins for Windows NT

    Similar to when you bring up SQL Studio, and do run as windows NT

    I want to ensure my rights are not removed from SQL Servers and if so send my nice DBA an email.

    How to do the connect as ? and check my permission is still set to access database with db_datawriter, db_datareader etc

    Thanks

  • maybe schedule a job in windows task scheduler that runs a query? could use sqlcmd, or a small dot net program.

  • Is the problem that on a regular basis your rights are removed from the server?

    The bigger question is why.

    Is this production? If so, and you are not part of the administrators at your company, then the DBA's are doing their jobs.

    There should be no reason for a high level of access to production. Read only maybe, but that's about it

    You can create a script and run it using SQLCMD. The problem here is that you probably do not have the level of rights to get the specific rights assignment for your login.

    sp_helprolemember or sp_helpsrvrolemember should give you what you need.

    Why can't you simply connect, try to do what you need to do, and then ask for permissions is needed?

    Michael L John
    If you assassinate a DBA, would you pull a trigger?
    To properly post on a forum:
    http://www.sqlservercentral.com/articles/61537/

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

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