Last Updated on August 18, 2021 by Admin 2
You have a SQL Server database named MyDB that uses SQL Server Authentication.
Which connection string should you use to connect to MyDB?
- Data Source=MyDB; UserID=username; Password=P@sswOrd; Initial Catalog=Sales
- Data Source=MyDB; Integrated Security=SSPI; Initial Catalog=Sales
- Data Source=MyDB; Integrated Security=True; Initial Catalog=Sales
- Data Source=MyDB; Trusted_Connection=True; MultipleActiveResultSets=True; Initial Catalog=Sales
Explanation:
Integrated Security
Integrated Security is by default set to false.
When false, User ID and Password are specified in the connection.
Incorrect:
not C: Windows Authentication (Integrated Security = true) remains the most secure way to log in to a SQL Server database.