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


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



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


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


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.


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


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'



Only a System Administrator can execute sp_bindexeclass.

See also

System procedures sp_addexeclass, sp_showexeclass, sp_unbindexeclass

Utility isql