SQL Server connection string
The Microsoft SQL Server connection string follows the JDBC standard
The following example uses integrated security (Windows only):
sqlserver://HOST:PORT;database=DATABASE;integratedsecurity=true
The following example uses SQL authentication (username and password):
sqlserver://HOST:PORT;database=DATABASE;user=USER;password=PASSWORD
Note: If you are connecting from MacOS and using a version of Prisma before 2.15.0, add
encrypt=DANGER_PLAINTEXT
to disable TLS and make it easier to work in . Do not do this in production.
Arguments
Argument name | Required | Default | Comments |
---|---|---|---|
database initial catalog | No | master | The database to connect to. |
username user uid userid | No - see Comments | SQL Server login (such as sa ) or a valid Windows (Active Directory) username if integratedSecurity is set to true (Windows only). | |
password pwd | No - see Comments | Password for SQL Server login or Windows (Active Directory) username if integratedSecurity is set to true (Windows only). | |
encrypt | No | Configures whether to use TLS, possible values: true , false , DANGER_PLAINTEXT DANGER_PLAINTEXT not required for MacOS in 2.15.0 and later. | |
integratedSecurity | No | Enables Windows authentication (integrated security), possible values: true , false , yes , no . If set to true or yes and username and password are present, login is performed through Windows Active Directory. If login details are not given via separate arguments, the current logged in Windows user is used to login to the server. | |
schema | No | dbo | Added as a prefix to all the queries if schema name is not the default. |
loginTimeout connectTimeout connectionTimeout | No | Number of seconds to wait for login to succeed. | |
socketTimeout | No | Number of seconds to wait for each query to succeed. | |
isolationLevel | No | Sets transaction isolation level. |
Scenarios
Using integrated security (Windows only)
The following example uses the currently logged in Windows user to log in to SQL Server:
sqlserver://localhost:1433;initialCatalog=sample;integratedSecurity=true;trustServerCertificate=true;
The following example uses a specific Active Directory user to log in to SQL Server:
sqlserver://localhost:1433;initialCatalog=sample;integratedSecurity=true;username=prisma;password=aBcD1234;trustServerCertificate=true;
Using SQL Browser to connect to a named instance
The following example connects to a named instance of SQL Server (mycomputer\sql2019
) using integrated security:
sqlserver://mycomputer\sql2019;initialCatalog=sample;integratedSecurity=true;trustServerCertificate=true;