CREST Practitioner Security Analyst (CPSA) Practice 2025 - Free CPSA Practice Questions and Study Guide

Question: 1 / 485

What does the command 'SELECT name, password_hash FROM master.sys.sql_logins' do in MS-SQL?

It lists all tables in the database

It provides information on password hashes for SQL logins

The command 'SELECT name, password_hash FROM master.sys.sql_logins' specifically queries the SQL Server's system view 'sql_logins', which resides in the 'master' database. This system view contains information about SQL Server logins, including their names and associated password hashes. By selecting the 'name' and 'password_hash' columns, the command retrieves a list of SQL login names along with their hashed passwords. This is particularly useful for database administrators who need to manage user access and ensure secure handling of user credentials.

In contrast to other options, this command does not relate to listing tables, displaying database versions, or retrieving current users. Listing tables would involve querying system catalogs like 'information_schema.tables' or 'sys.tables', while database version information can be obtained using commands such as 'SELECT @@VERSION'. The current users in a session would typically be identified using functions like 'SESSION_USER' or views that provide active sessions, rather than directly querying the 'sql_logins' view. Therefore, the selection of option B correctly captures the specific functionality of the provided SQL command.

Get further explanation with Examzify DeepDiveBeta

It displays the version of the database

It retrieves the names of current users

Next Question

Report this question

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy