Query SQL command
The query sql command queries the local SQL Server to return general information and status about the SQL Server, databases, and VSS components.
Use the query sql command to return the following information:
- SQL
Server information:
- SQL Server name and version
- Database name
- Database data space allocated
- Database space that is used
- Database log space allocated
- Database log space used
- Database options that are set (SELECT INTO / BULK COPY, TRUNCATE LOG ON CHECKPOINT, and other options.)
- VSS information:
- Writer Name
- Local DSMAgent Node
- Remote DSMAgent Node
- Writer Status (online, offline)
- Number of selectable components
- If you specify
/compatibilityinfo:
- Server clustering state
- Database compatibility level
- Query SQL syntax Use the query sql command syntax diagrams as a reference to view available options and truncation requirements.
-
Query SQL positional parameters
Positional parameters immediately follow the query command and precede the optional parameters.
-
Optional parameters follow the query sql command and positional parameters.
-
This output example provides a sample of the text, messages, and process status that displays when you use the query SQL command.