Guide: Using Microsoft SQL Server with Databox
Microsoft SQL is a relational database management system developed by Microsoft. As a database server, it is a software product with the primary function of storing and retrieving data as requested by other software applications. These applications may run on either the same computer or on another computer across a network, including the internet.
Microsoft SQL connections are available in Plus and Business Accounts. Agency Basic Accounts have the ability to use Microsoft SQL in the Agency Account only.
How to prepare your Microsoft SQL Database
IN THIS SECTION
How to configure TCP access to your Microsoft SQL Server
Make sure Port forwarding is set up for your Firewall. In our example, Port 1433 must be reachable from Databox's public IP (22.214.171.124). If this is not done, timeout errors will occur when attempting to connect remotely.
We'll unpack this in the folder
c:\Samples\AdventureWorks and open the instawdb.sql file in our SQL Server. Choose the SQLCMD Mode option from the Query Menu.
If the SQL file is not stored in the default location or if you want to customize the Database name, update the two vars as you see fit.
If the query was not executed successfully, please go back and re-check all steps above, or contact Databox Support at [email protected] additional assistance.
How to set up a remote Microsoft SQL user
To access the database remotely, we’ll add a new user with limited privileges and enable the user on our new database
For further security considerations, feel free to consult Microsoft's SQL Server Documentation.
How to connect Microsoft SQL to Databox
Once our Database is properly prepared, we'll connect it to Databox.
To connect Microsoft SQL to Databox, go to Data Sources > + New connection. Type SQL in the search bar and click on the green Connect button.
This will open the Activation window, which is where you will be prompted to enter your connection data and authorize the Databox app.
Enter an arbitrary name for this connection and all of the additional information you’re prompted to add.
Click Activate. If a timeout error occurs, Databox couldn’t connect to the server. This is possibly due to a Firewall issue. In this case, check to ensure you have forwarded the Port and enabled it for Databox's public IP (126.96.36.199).
How to use the Query Builder for Microsoft SQL
The Query Builder for Microsoft SQL allows you to create Custom Metrics using data from your Database to use in Databoards, Alerts, Goals, etc. Learn more about the Query Builder for Microsoft SQL here.
- The query must limit the query result to a maximum of 1000 rows. LIMIT the query if you’re not sure if you will exceed this number.
- The query must contain a column named “data” (using AS when SELECT-ing data is perfectly acceptable)
- One column must contain the Date value. You can cast any column to name “date” using the “AS” SQL syntax
- One column should always contain the Metric Value
- Make sure your Firewall is open to Databox's public IP and your Port is correctly forwarded to the server
- Query results are limited to 1000 rows. If you expect your query to return over 1000 rows or if you're not sure how many rows will be returned, be sure to LIMIT the query
- The query must contain a column named "Date." If you need to, use AS in your SELECT statement to satisfy this requirement
- "Null" values will not be recognized. Use a COALESCE function when needed. Learn more here.