ServerSelectionTryOnce

Key Name Default Value Required

ServerSelectionTryOnce

1

No

Description

This option specifies whether, if the initial server selection fails, the connector searches for a server only once, or continues searching until the timeout value is reached.

  • 1: If the initial server selection fails, the connector searches for a server only once, and then either selects a server or returns an error.
  • 0: The connector continues searching for a server until it either selects a server or times out with an error. The default timeout value is 5000 milliseconds, and can be changed with the ServerSelectionTimeoutMS property (see ServerSelectionTimeoutMS).

Note:

If this property is set to 1 or is not explicitly set, the server selection timeout value is specified in the SQL_ATTR_LOGIN_TIMEOUT attribute. The default value for SQL_ATTR_LOGIN_TIMEOUT is 5000 milliseconds.