For Version 184.108.40.2066 and all subsequent versions, unless a "behavior change" is documented, is it safe to assume that CONNECTION_PROPERTY ( 'Name' ) evaluated inside an event will always return the event name as defined by the CREATE EVENT statement?
I want to write the following...
if another invocation of this event is already running then quit this invocation of the event;
and I plan to query sa_conn_info() to do that.
The value of connection_property('Name',number) for an event will be the name of the event; however, there is nothing preventing a normal connection from using the same name. The value of connection_property('EventName',number) is also the name of the event, but will be NULL for non-event connections. If this is the only property you are going to be using, sa_conn_list() is a more efficient way to get a list of connections. sa_conn_list was added in version 10. To limit the number of instances of an event that are active, checking the value of event_parameter('NumActive') within the event is the simplest approach.
answered 15 Oct '10, 13:25