GET_SQL_CONTAINED_DB_MODE¶
Applies to: SQLFlex
Gets the current contained db mode. Connecting to a contained db is a bit different in that you’re connecting to the database rather than to the server. When using this mode (which should be specified BEFORE login) you are not able to use/switch to another database because your connection is isolated to this database. This mode is used for Always On Failover Clustering as well. When connecting to a failover cluster, a contained db must be used. Also, when logging in, the server name should be the failover cluster name rather than the individual server instance name.
Syntax
GET_SQL_CONTAINED_DB_MODE to {variable}
Example
GET_SQL_CONTAINED_DB_MODE to iMode
If (iMode) Showln "Currently in Contained DB Mode!"