Logins no longer exists.

Today while checking the logins, just want to clear/clean logins which are no longer exists on NT domain.

To get the logins which are no longer exits run the following:

EXEC master.dbo.sp_validatelogins


It will show you the list of SID and logins which are not exists. And then after that run the below command to remove that login.

Exec.sp_revokelogin ‘domain\Login name’


This is old commands and will be remove in future release… so if you are using sql server 2005 and above use below command which will be same as sp_revokelogin.

DROP LOGIN login_name


You can use the Enterprise Manager or SSMS for the same.

Go to Securities –> logins –> Right click and Delete login.



twitter @thakurvinay.

This entry was posted in What I learned today and tagged . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.