Connect to SQL Data base with Visual Studio and SSDT in D365FO

Use Visual Studio to query Azure SQL Data Warehouse in just a few minutes. This method uses the SQL Server Data Tools (SSDT) extension in Visual Studio.

Prerequisites

To use this tutorial, you need:

1. Connect to your SQL Data Warehouse

  1. Open Visual Studio 2013 or 2015.
  2. Open SQL Server Object Explorer. To do this, select View > SQL Server Object Explorer.
    SQL Server Object Explorer
  3. Click the Add SQL Server icon.
    Add SQL Server
  4. Fill in the fields in the Connect to Server window.
    Connect to Server
    • Server name. Enter the server name previously identified.
    • Authentication. Select SQL Server Authentication or Active Directory Integrated Authentication.
    • User Name and Password. Enter user name and password if SQL Server Authentication was selected above.
    • Click Connect.
  5. To explore, expand your Azure SQL server. You can view the databases associated with the server. Expand AdventureWorksDW to see the tables in your sample database.
    Explore AdventureWorksDW

2. Run a sample query

Now that a connection has been established to your database, let's write a query.
  1. Right-click your database in SQL Server Object Explorer.
  2. Select New Query. A new query window opens.
    New query
  3. Copy this TSQL query into the query window:
    SQL
    SELECT COUNT(*) FROM dbo.FactInternetSales;
    
  4. Run the query. To do this, click the green arrow or use the following shortcut: CTRL+SHIFT+E.
    Run query
  5. Look at the query results. In this example, the FactInternetSales table has 60398 rows.
    Query results

Comments