sp_bindexeclass

Description

Associates an execution class with a client application, login, or stored procedure.

Syntax

sp_bindexeclass "object_name", "object_type", "scope", "classname"

Parameters

object_name

is the name of the client application, login, or stored procedure to be associated with the execution class, classname.

object_type

identifies the type of object_name. Use ap for application, lg for login, or pr for stored procedure.

scope

is the name of a client application or login, or it can be NULL for ap and lg objects. It is the name of the stored procedure owner (user name) for objects. When the object with object_name interacts with the application or login, classname attributes apply for the scope you set.

classname

specifies the type of class to associate with object_name. Values are:

  • EC1, EC2, or EC3

  • The name of a user-defined execution class

  • ANYENGINE

Examples

Example 1

This statement specifies that Transact-SQL applications will execute with EC3 attributes for any login or application process (because the value of scope is NULL) that invokes isql, unless the login or application is bound to a higher execution class:

sp_bindexeclass 'isql', 'ap', NULL, 'EC3'

Example 2

This statement specifies that when a login with the System Administrator role executes Transact-SQL applications, the login process executes with EC1 attributes. If you have already executed the statement in the first example, then any other login or client application that invokes isql will execute with EC3 attributes:

sp_bindexeclass 'sa', 'lg', 'isql', 'EC1'

Example 3

This statement assigns EC3 attributes to the stored procedure named my_proc owned by user kundu:

sp_bindexeclass 'my_proc', 'PR', 'kundu', 'EC3'

Usage

Permissions

Only a System Administrator can execute sp_bindexeclass.

Auditing

Values in event and extrainfo columns from the sysaudits table are:

Event

Audit option

Command or access audited

Information in extrainfo

38

exec_procedure

Execution of a procedure

  • Roles – Current active roles

  • Keywords or options – NULL

  • Previous value – NULL

  • Current value – NULL

  • Other information – All input parameters

  • Proxy information – Original login name, if set proxy in effect

See also

System procedures sp_addexeclass, sp_showexeclass, sp_unbindexeclass

Utility isql