Drop Login from all databases that has the login name
Posted on 2012-03-22
I need a generic script that drops a particular user from all the databases(which consists the user). I tried drop login username, but it does not delete from databases, it just deletes the login entry from the MAIN SECURITY folder of the SQL Instance.
If I have a login names 'LOGINABC', which has access to 15 out of 15databases in a instance.
When I execute the generic script, it should drop the login entry from main SECURITY>LOGINS under the SQL Instance and also from the 15 Databases (which will be under the Database>Security>Users).