Ir al contenido

Microsoft SQL Server

Esta página aún no está disponible en español. Se muestra la versión en inglés.

Connect Querri to your Microsoft SQL Server database, choose the tables to load, and ask questions about them in plain language.

The SQL Server connector copies the tables you choose into Querri. It uses SQL Server authentication (a username and password) over the ODBC Driver 18 for SQL Server, and can reach private databases through an OpenVPN tunnel.

  • A SQL Server instance Querri can reach, with TCP/IP enabled
  • A SQL Server login, ideally read-only (see Database user setup)

If your server only accepts connections from known addresses, allow Querri’s outbound IP address in its firewall. For a server reachable only over a private network, use Connect via VPN (Advanced).

To enable TCP/IP on an on-premises server:

  1. Open SQL Server Configuration Manager.
  2. Go to SQL Server Network Configuration → Protocols.
  3. Enable TCP/IP.
  4. Restart the SQL Server service.
  1. Open the connector. Click Connect in the app rail and pick Microsoft SQL Server under Connect a data source, or click Connect on it in Settings → Connectors (admins).

  2. Enter connection settings:

    FieldDefault
    Connector NameSQL Server
    Host *
    Port1433
    Username *
    Password
    DatabaseOptional; leave blank to discover from the server
    Trust Server CertificateOn
    Encrypt ConnectionOff
    Connect via VPN (Advanced)Off

    The driver is fixed to ODBC Driver 18 for SQL Server.

  3. Test the connection. Click Test connection and discover access. This creates the connector, then tests it and lists the databases and schemas the login can read.

  4. Select data. Pick a database and schema (the schema defaults to dbo). All Tables is on by default; turn it off to choose tables. Add Custom SQL Queries to load a query’s result as its own source.

  5. Check advanced settings. Limit rows per table is off, so every row loads.

  6. Load your data. Click Save and Load Data. A progress card shows each table loading, then offers View in Library and Sync daily.

-- Create login
CREATE LOGIN querri_readonly
WITH PASSWORD = 'SecurePassword123!';
-- Switch to your database
USE your_database;
-- Create user
CREATE USER querri_readonly
FOR LOGIN querri_readonly;
-- Grant read permissions
ALTER ROLE db_datareader ADD MEMBER querri_readonly;
-- Allow view of database metadata
GRANT VIEW DEFINITION TO querri_readonly;
-- Create user with no default role
CREATE USER querri_readonly FOR LOGIN querri_readonly;
-- Grant access to specific tables only
GRANT SELECT ON dbo.orders TO querri_readonly;
GRANT SELECT ON dbo.customers TO querri_readonly;
GRANT SELECT ON dbo.products TO querri_readonly;
-- Or grant access to an analytics schema only
GRANT SELECT ON SCHEMA::analytics TO querri_readonly;

See Database Best Practices for analytics views and access.

SELECT
dp.name as username,
dp.type_desc,
o.name as object_name,
p.permission_name,
p.state_desc
FROM sys.database_permissions p
JOIN sys.database_principals dp ON p.grantee_principal_id = dp.principal_id
LEFT JOIN sys.objects o ON p.major_id = o.object_id
WHERE dp.name = 'querri_readonly';

The connector’s owner can keep SQL Server data up to date on the Schedule tab, with Full Refresh, Incremental, or both. For incremental syncs, use a cursor column that changes whenever a row does, typically a datetime2 or datetimeoffset column like ModifiedDate, or an IDENTITY column for append-only tables.

Scheduled syncs use credits when they run. See the Sync Scheduling guide.

  1. Check that the firewall allows Querri’s address, or that the VPN files are loaded.
  2. Check that SQL Server is running and TCP/IP is enabled.
  3. For named instances, check that the SQL Server Browser service is running.
  4. Check that port 1433 (or your custom port) is open.
  1. Check the username and password.
  2. Check that SQL Server authentication is enabled on the server.
  3. Check the login exists: SELECT * FROM sys.server_principals;
  4. For Azure SQL, try the username@servername format.
  1. Check the database name.
  2. Check that the user has access to the database and that it’s online.
  1. If the server uses a self-signed certificate, keep Trust Server Certificate on.
  2. If the server requires encrypted connections, turn on Encrypt Connection.
  3. For the strictest setup, install a valid certificate on the server, turn on Encrypt Connection, and turn off Trust Server Certificate.
  • Use read-only credentials, such as the db_datareader role.
  • Encrypt connections with a valid server certificate where you can.
  • Grant only the tables and schemas people need.