DENY SQL Server Login

  • You can DENY a Windows Login using sp_denylogin however, you cannot use sp_denylogin to deny an SQL Server Login.

    Is there any way you can deny an SQL Server Login without having to actually use sp_revokelogin which actually removes the Login from the SQL Server?


    Kindest Regards,

  • - you can deny the users rights to any object in the database. Check BOL !

    DENY

        { ALL [ PRIVILEGES ] | permission [ ,...n ] }

        {

            [ ( column [ ,...n ] ) ] ON { table | view }

            | ON { table | view } [ ( column [ ,...n ] ) ]

            | ON { stored_procedure | extended_procedure }

            | ON { user_defined_function }

        }

    TO security_account [ ,...n ]

    [ CASCADE ]

     - If you don't want a sql-userid to be used by others, you can always change its password

    Johan

    Learn to play, play to learn !

    Dont drive faster than your guardian angel can fly ...
    but keeping both feet on the ground wont get you anywhere :w00t:

    - How to post Performance Problems
    - How to post data/code to get the best help[/url]

    - How to prevent a sore throat after hours of presenting ppt

    press F1 for solution, press shift+F1 for urgent solution 😀

    Need a bit of Powershell? How about this

    Who am I ? Sometimes this is me but most of the time this is me

  • You can remove access to all databases.  The login would still function, but have no access to any data.

    So long, and thanks for all the fish,

    Russell Shilling, MCDBA, MCSA 2K3, MCSE 2K3

  • The easiest way that I found to do this is just to change the password.  That way you don't have to reconfigure any rights or permissions if you want to re-allow access.
     

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

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