What is the SQL query to check whether particular SQL Login is Enable or Disable?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Updated after OP question:
‘guest’ is not a login (server principal) is an user (database principal) so you need to look for it in
sys.database_principals. Users cannot be enabled nor disabled, they simply exist or don’t exist.guestis a special built-in user that maps all server principals that are not explicitly mapped to another user: that is server principals (logins) that have access to the database but do not have a database principal (user) with a matching SID will be mapped to ‘guest’. Except members of sysadmin role which are always mapped todbo.