SQL Server Connection String Builder & Parser
Enter a server, database and credentials to get a correct Microsoft SQL Server connection string for Microsoft.Data.SqlClient (ADO.NET), ODBC Driver 18, the Microsoft JDBC driver, sqlcmd, Python pyodbc and SQLAlchemy — or paste an existing string or jdbc:sqlserver:// URL to break it into fields. Named instances, SQL, Windows and Microsoft Entra ID authentication, Encrypt and TrustServerCertificate are handled, and passwords with semicolons or quotes are escaped the way each driver expects. Everything runs in your browser; nothing is uploaded.
Do more than sql server connection string builder & parser — meet Chat2DB
Chat2DB is an AI-powered SQL client for Windows, macOS and Linux. Write SQL in natural language, format and optimize queries automatically, and manage MySQL, PostgreSQL, Oracle and 20+ other databases in one workspace.
How to use
- Enter the server host, an optional port or named instance (e.g. SQLEXPRESS) and the database, then pick SQL Server, Windows or Microsoft Entra ID authentication.
- Set Encrypt, TrustServerCertificate, timeout, application intent and pooling options — or paste an existing ADO.NET, ODBC or JDBC string and click Parse to fill every field.
- Review the warnings, switch between the ADO.NET, ODBC, JDBC, sqlcmd, Python and SQLAlchemy tabs and copy the result (enable Mask password before sharing).
Frequently asked questions
What is the SQL Server connection string format?
For .NET (Microsoft.Data.SqlClient) it is a list of key=value pairs separated by semicolons, for example Server=tcp:sql01.example.com,1433;Database=AppDb;User ID=app_user;Password=secret;Encrypt=True;. Keywords are case-insensitive and have synonyms: Data Source, Address and Addr mean Server, Initial Catalog means Database. A named instance is written host\SQLEXPRESS and a non-default port is appended after a comma. ODBC uses the same shape with a Driver={ODBC Driver 18 for SQL Server} entry and Uid/Pwd, while JDBC uses a URL such as jdbc:sqlserver://host:1433;databaseName=AppDb;encrypt=true;.
Why do I get a certificate error after upgrading the driver?
Microsoft.Data.SqlClient 4.0 and ODBC Driver 18 for SQL Server changed the default of Encrypt to true (Mandatory), and JDBC driver 10.2 did the same. The client now validates the server's TLS certificate, so servers that use a self-signed certificate — typical for local installs and Docker containers — fail with an error like 'The certificate chain was issued by an authority that is not trusted'. The proper fix is to install a certificate your clients trust; for development you can add TrustServerCertificate=True (yes for ODBC). Encrypt=Strict (TDS 8.0, SQL Server 2022 and Azure SQL) always validates the certificate.
How do I escape a semicolon or quote in a SQL Server password?
In an ADO.NET string, wrap the value in double quotes and double any double quote inside it, e.g. Password="p@ss;w""rd"; a value that contains double quotes but no single quotes can be wrapped in single quotes instead. ODBC and JDBC wrap the value in braces and double any closing brace, e.g. Pwd={p@ss;w}}rd}. URL forms such as SQLAlchemy need percent-encoding instead: p@ss:w/rd becomes p%40ss%3Aw%2Frd. This builder applies the right rule for every output. Once connected, you can query and manage SQL Server with Chat2DB — download it free at https://chat2db.ai/download.
