sp_bindexeclass

Description

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

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. If object_type is df, it should be null.

object_type

identifies the type of object_name. Use:

  • ap for application

  • df for user-defined default execution class

  • lg for login

  • pr for stored procedure

  • sv for a service task (valid only in threaded mode)

scope

is the name of a client application or login, or it can be NULL for ap, df, lg, or sv objects. For objects, scope is the name of the stored procedure owner (user name). 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 executes 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'

Example 4

This statement assigns CLASS1 attributes to all tasks that are running with default execution attributes:

sp_bindexeclass NULL, 'DF', NULL, 'CLASS1'

Example 5

Binds the license heartbeat operation to the core execution task:

sp_bindexeclass "License Heartbeat", sv, NULL, core

Usage

Permissions

The permission checks for sp_bindexeclass differ based on your granular permissions settings.

Granular permissions enabled

With granular permissions enabled, you must be a user with manage any execution class privilege.

For ECO, you must be a user with manage any execution class and sybase_ts_role.

Granular permissions disabled

With granular permissions disabled, you must be a user with sa_role.

For ECO, you must be a user with sa_role and sybase_ts_role.

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