Show TOC

SQL Command EditorLocate this document in the navigation structure

Use

The command window allows the database administrator or support personnel with the required privileges to execute Transact SQL commands on the SQL Server and examine the results.

You can invoke this feature using transaction DBACOCKPIT. Then choose Diagnostics → SQL Command Editor.

Prerequisites

To access the SQL Command Editor the user must have authorization to start transactionssm49 andsm69. The values STOR and SMSS must also be applied to the S_ADMI_FCD authorization object. For more information, see SAP Note 767821.

In addition the user must have the highest available privilege to access the database connection of the system being monitored (DBCON access). This is described in SAP Note 767821 as well.

Features

This transaction shows an edit window allowing a free form entry of Transact SQL statements. The connection context is that of the SAP monitor, which in most cases is running under user privileges 'dbo'. This means that to access tables of the SAP system using a SELECT statement, the table names have to be qualified like this:

SELECT * from <sapsid>.<TABLE>

The SAP system ID (<sapsid>) in lowercase must be used to qualify the table names.

To execute a statement press the Execute button. This shows the output of the command in the Output tab of the main screen.

To Explain a statement, press the Explain button. This produces a showplan (see SQL Server Books Online) tree and this tree is displayed in the Explain Tree tab of the main screen. To view a textual format of the Explain tree you can select the Explain Text tab. This output also contains additional density information for any indexes on the tables involved.

The showplan output can also be viewed as a raw XML file in a browser or as a full graphical showplan in the SQL Server Management Studio.