Quantcast
Channel: CodeSection,代码区,SQL Server(mssql)数据库 技术分享 - CodeSec
Viewing all articles
Browse latest Browse all 3160

Shortcut: Adding additional parameters to connections in SSMS

$
0
0

When I am writing my own code using a .NET (or other) language, I have a great deal of control of how the connection string that my application uses to connect to SQL Server is configured.

In particular, I might need to add another parameter or two.

As a simple example, you might have a multi-subnet Availability Group, spread across a production site and a disaster recovery site. It's common to then have an Availability Group Listener in both subnets.

If you add the parameter MultiSubnetFailover=true to your connection string, when SQL Server attempts to connect to the listener, it will send a request to each IP address concurrently, not just to one at a time. It will then connect to whichever server responds first.

This is great, but how do we do that with SQL Server Management Studio (SSMS) connections?

The answer is that in the database server connection dialog, we can choose Options:


Shortcut: Adding additional parameters to connections in SSMS

In the dialog that appears, there is a tab for Additional Connection Parameters:


Shortcut: Adding additional parameters to connections in SSMS

On that tab, I can enter the required details:


Shortcut: Adding additional parameters to connections in SSMS

Note also that if you enter a value here that is also on the graphical connection pages, the value that you enter overrides those values.


Viewing all articles
Browse latest Browse all 3160

Trending Articles