Microsoft SQL Server Connection Strings
Microsoft SQL Server is a relational database management system (RDBMS) produced by Microsoft. Its primary query languages are T-SQL, Entity-SQL and ANSI SQL.
Below are some versions of Microsoft SQL Server:
- SQL Server Compact Edition (SQL CE)
- SQL Server Developer Edition
- SQL Server 2005 Embedded Edition (SSEE)
- SQL Server Enterprise Edition
- SQL Server Evaluation Edition
- SQL Server Express Edition
- SQL Server Fast Track
- SQL Server Standard Edition
- SQL Server Web Edition
- SQL Server Workgroup Edition
Variable Legend
| Variable Name | Substitute variable with: |
|---|---|
| Server | Replace with your server host address. |
| DBName | Replace with your database name |
| User | Replace with your database's username |
| Password | Replace with your database's password |
SQL ODBC connection strings
Standard Security:
"Driver={SQLServer};Server=Server=DBName;Uid=User;Pwd=Password;"
Trusted connection:
"Driver={SQLServer};Server=Server;Database=DBName;Trusted_Connection=yes;"
SQL OLE DB connection strings
Standard Security:
"Provider=SQLOLEDB;Data Source=Server;Initial Catalog=DBName;UserId=User;Password=Password;"
Trusted connection:
"Provider=SQLOLEDB;Data Source=Server;Initial Catalog=DBName;Integrated Security=SSPI;"
SQL OleDbConnection .NET strings
Standard Security:
"Provider=SQLOLEDB;Data Source=Server;Initial Catalog=DBName;UserId=User;Password=Password;"
Trusted connection:
"Provider=SQLOLEDB;Data Source=Server;Initial Catalog=DBName;Integrated Security=SSPI;"
SQL SqlConnection .NET strings
Standard Security:
Data Source=Server;Initial Catalog=DBName;UserId=User;Password=Password;"
"Server=Server;Database=DBName;UserID=User;Password=Password; Trusted_Connection=False"
Trusted connection:
"Data Source=Server;Initial Catalog=DBName;Integrated Security=SSPI;"
"Server=Server;Database=DBName;Trusted_Connection=True;"