Enable / Disable Users In Database

I normally see this issue when connect permission is removed/revoked from the database

USE DatabaseName
GO
GRANT CONNECT TO LoginName

You can check which users in a database have the CONNECT permission by executing this T-SQL:

USE DatabaseName
GO
SELECT name, hasdbaccess FROM sys.sysusers WHERE name = 'LoginName'

Leave a Reply

Your email address will not be published. Required fields are marked *