Microsoft SQL Server

    [!NOTE] Limitations in Web. In the Slingshot Web app, you can connect only to publicly accessible Microsoft SQL addresses. If your MS SQL address is restricted for the general public (private or hosted in the company's intranet, for example), you can use Slingshot Desktop, iOS or Android to connect to it. The device, where you're running Slingshot on, needs to have access to the SQL Server address. This limitation does not apply to Slingshot Embedded.

    Connecting to MS SQL Server

    To configure a Microsoft SQL Server data source, you can set the following information:

    Enter SQL Server Details in the dialog
    1. Server: the computer name or IP address assigned to the computer on which the server is running.

    2. Port: if applicable, the server port details. If no information is entered, Analytics will connect to the port in the hint text (1433) by default.

    3. Credentials: after selecting Credentials, you will be able to enter the credentials for your Microsoft SQL Server or choose existing ones if applicable.

      • Username: the user account for the SQL Server or the name of the domain.

      • Password: the password to access the SQL Server.

      • Alias: Your data source name will be displayed in the list of accounts in the previous dialog. By default, Analytics names it Microsoft SQL Server. You can change it to your preference.

      Once ready, select Add and then Add Server.

    How to find your Server Information

    You can find your server by following the steps below. Please note that the commands should be executed on the server.

    WINDOWS LINUX MAC
    1. Open the File Explorer. 1. Open a Terminal. 1. Open System Preferences.
    2. Right Click on My Computer > Properties. 2. Type in $hostname 2. Navigate to the Sharing Section.
    Your Hostname will appear as "Computer Name" under the Computer name, domain and workgroups settings section. Your Hostname will appear along with your DNS domain name. Make sure you only include the Hostname in Analytics. Your Hostname will be listed under the "Computer Name" field on top.

    You can find your IP address by following the steps below. Please note that the commands should be executed on the server.

    WINDOWS LINUX MAC
    1. Open a Command Prompt. 1. Open a Terminal. 1. Launch your Network app.
    2. Type in ipconfig 2. Type in $ /bin/ifconfig 2. Select your connection.
    IPv4 Address is your IP address. Inet addr is your IP address. The IP Address field will have the necessary information.

    Setting Up Your Data

    Working with Views

    With Analytics, you can retrieve SQL Server data from entire tables, but you can also select a particular view that returns a subset of data from a table or a set of tables instead.

    Views in Microsoft SQL

    In the example below, the Invoices view contains part of the data in the Alphabetical list of products table in the SQL Server.

    Dashboard presenting data from Microsoft SQL views

    Working with Stored Procedures

    In MS SQL, stored procedures allow users to run a set of query statements in a relational database with specific parameters. The following are just a set of sample stored procedures running in a test server with Northwind data:

    Microsoft SQL Stored Procedures list

    This stored procedure, for example, returns the products in the Products table ordered by their Unit Price. The ProductName has been renamed to TenMostExpensiveProducts.

    Example of Microsoft SQL Stored Procedure dashboard

    In this case, the stored procedure requires users to add the order ID in order display the CustOrdersDetail information.

    Microsoft SQL Stored Procedure Parameters example

    For more information on Stored Procedures and MS SQL Server, visit this documentation website.

    Limitations for Stored Procedures in Analytics

    • For stored procedures that return more than one result set, Analytics displays only the first one.

    • Output parameters in stored procedures are ignored.

    • Stored procedures that return no result sets will be listed in the Data Sources list but will fail.