Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between Trusted_Connection and Integrated Security in a connection string?

I'm curious what the difference between the token "Trusted_Connection" and "Integrated Security" in SQL Server connection strings (I believe other databases/drivers don't support these). I understand that they are equivilent.

like image 549
Peter Oehlert Avatar asked Jun 19 '10 22:06

Peter Oehlert


People also ask

What does integrated security mean in connection string?

Integrated Security=SSPI" SSPI stands for Security Support Provider Interface. The SSPI allows an application to use any of the available security packages on a system without changing the interface to use security services.

What is difference between Integrated security true and SSPI?

Integrated Security = true : the current Windows account credentials are used for authentication. Integrated Security = SSPI : this is equivalant to true. Show activity on this post. false User ID and Password are specified in the connection string.

What does integrated security mean?

Integrated security systems are a type of multi-layered system that uses different components and threads them into one. At Sonitrol, we utilize a layered system consisting of audio-based intrusion detection, alarm notifications, a 24/7 staff, commercial access control, fire and smoke detection, and video monitoring.

What is meaning of initial catalog and integrated security in connection string?

Initial Catalog is the name of the database to be used by the connection string, which is located on the server that was specified in the Data Source part of the connection string.


1 Answers

They are synonyms for each other and can be used interchangeably.

In .Net, there is a class called SqlConnectionStringBuilder that is very useful for dealing with SQL Server connection strings using type-safe properties to build up parts of the string. This class keeps an internal list of synonyms so it can map from one value to another:

 +----------------------+-------------------------+ | Value                | Synonym                 | +----------------------+-------------------------+ | app                  | application name        | | async                | asynchronous processing | | extended properties  | attachdbfilename        | | initial file name    | attachdbfilename        | | connection timeout   | connect timeout         | | timeout              | connect timeout         | | language             | current language        | | addr                 | data source             | | address              | data source             | | network address      | data source             | | server               | data source             | | database             | initial catalog         | | trusted_connection   | integrated security     | | connection lifetime  | load balance timeout    | | net                  | network library         | | network              | network library         | | pwd                  | password                | | persistsecurityinfo  | persist security info   | | uid                  | user id                 | | user                 | user id                 | | wsid                 | workstation id          | +----------------------+-------------------------+ 

(Compiled with help from Reflector)

There are other similar classes for dealing with ODBC and OleDb connection strings, but unfortunately nothing for other database vendors - I would assume the onus is on a vendor's library to provide such an implementation.

like image 75
adrianbanks Avatar answered Sep 21 '22 22:09

adrianbanks