CONNECTION_PROPERTY Function [System]

Returns the value of a given connection property as a string.

Syntax

CONNECTION_PROPERTY ( { integer-expression1 | string-expression }
                                                     … [ , integer-expression2 ] )
Note: CIS functional compensation performance considerations apply.

Parameters

Parameter

Description

integer-expression1

In most cases, it is more convenient to supply a string expression as the first argument. If you do supply integer-expression1, it is the connection property ID. You can determine this using the PROPERTY_NUMBER function.

string-expression

The connection property name. You must specify either the property ID or the property name.

integer-expression2

The connection ID of the current database connection. The current connection is used if this argument is omitted.

Returns

VARCHAR

Remarks

The current connection is used if the second argument is omitted.

Standards and Compatibility

  • Vendor extension to ISO/ANSI SQL grammar.

  • Compatible with Adaptive Server.

Example

The following statement returns the number of prepared statements being maintained, for example, 4:

SELECT connection_property( 'PrepStmt' )FROM iq_dummy
Related concepts
Properties Available for the Server
Properties Available for Each Database
Connection Properties
Related reference
PROPERTY Function [System]
PROPERTY_NAME Function [System]
PROPERTY_NUMBER Function [System]
sp_iqshowpsexe Procedure
sp_iqcontext Procedure