Top > How to import data > Importing SQL Server data > To import data from a SQL Server query:
Go to the Data Management workspace > Import view.
In the Tasks pane, click Import SQL Server Data. The Import Wizard opens.
Choose a Template Definition. Even if you do not wish to create a new template, you can choose not to save the template at the end of the wizard.
Select an Error Handling option to determine whether the wizard should proceed or not when it encounters an error.
Click Next. The Enter Database Information & Query page opens.
Select the Database server name from the list of database servers found on the network. If a database server is new, it may not appear in the list. If your database server does not appear on the list, enter the name manually.
Select the Database name from the list of databases found on the server or enter the name manually.
Click Test Connection to ensure that the management pack can connect to the database.
Enter the SQL Server query in the Query Definition field. The SQL query is saved with the template if you choose to save it.
Click Next. The Source Preview page opens. The preview lets you determine whether the query and connection details return the results you expect. Click Previous if you need to change the database or your query.
Click Next to map the data retrieved from the database to an object and its properties.
Continue with Creating and configuring objects.