Wesbytes Knowledge Base

Search our articles or browse by category below

Connection String for SQL Server

Last modified: June 28, 2022
You are here:
Estimated reading time: < 1 min

Connection string with standard security:
Data Source=SQL_SERVER_IP,MSSQL_PORT;
Initial Catalog=DATABASE_NAME;
User Id=DATABASE_USER;
Password=DATABASE_USER_PASSWORD;

Alternative syntax 1:
Server=SQL_SERVER_IP,MSSQL_PORT;Database=DATABASE_NAME;
User id=DATABASE_USER;
Password=DATABASE_USER_PASSWORD;
Trusted_Connection=False;

Alternative syntax 2:
Server=SQL_SERVER_IP,MSSQL_PORT;
Database=DATABASE_NAME;
User id=DATABASE_USER;
pwd=DATABASE_USER_PASSWORD;

Was this article helpful?
Dislike 0
Views: 3