This article covers:
To make a connection to SQL Server, navigate to the Connections page, select New Connection, then SQL Server from the New Connection modal:
You will be prompted to provide the following connection details to establish a connection to your SQL Server database:
Notes:
ApplicationIntent=ReadOnly, ensuring that read-only replicas are being used if possible to run the queries! Once you have connected your SQL Server you can add datasets as explained here.
{{metadata.< parameter name >|< default value >}}. Find out more about parameterized SQL Datasets.Note: you can connect your datasets with topography data (geometry/geography types) via our connector.
Also make sure to check out this article on Preparing your data for analytics.
To find out how to add datasets using our API, please refer to the examples in our developer documentation.
When generating an Authorization token to grant a user acces to your embedded dashboards it is possible to override the data source properties in the authorization request to dynamically use different properties. Find out more about connection overrides.
The fields available for overriding a SQL Server connection are as follows:
Our developer documentation has more info about connection overrides and examples of SQL Server connection overrides.
Example code demonstrating how to override a SQL Server connection:
import Luzmo from '@luzmo/nodejs-sdk';
const client = new Luzmo({
api_key: '<your Luzmo API key>',
api_token: '<your Luzmo API token>',
host: 'https://api.luzmo.com:443'
});
const response = await client.create('authorization',
{
type: "embed",
username: "< A unique and immutable identifier for your user >",
name: "< user name >",
email: "< user email >",
suborganization: "< a suborganization name >",
access: {
collections: [
{
id: "<collection_id>",
inheritRights: "use"
}
]
},
account_overrides: {
<your connection_id>: {
host: "<The new database host URL to connect to>",
user: "<username>",
password: "<password>"
}
}
}
);
| Data Type in SQL Server | Data Type in Luzmo |
|---|---|
| bigint | numeric |
| binary | hierarchy |
| bit | hierarchy |
| char | hierarchy |
| nchar | hierarchy |
| date | datetime |
| datetime | datetime |
| datetime2 | datetime |
| datetimeoffset | datetime |
| decimal | numeric |
| float | numeric |
| int | numeric |
| money | numeric |
| ntext | hierarchy |
| numeric | numeric |
| nvarchar | hierarchy |
| real | numeric |
| rowversion | numeric |
| smalldatetime | datetime |
| smallint | numeric |
| smallmoney | numeric |
| text | hierarchy |
| time | datetime |
| timestamp | datetime |
| tinyint | numeric |
| uniqueidentifier | hierarchy |
| varbinary | hierarchy |
| varchar | hierarchy |
| xml | hierarchy |
| hierarchyid | hierarchy |