Is it possible, within events triggered by "Connect, Disconnect and ConnectFailed" to determine more than the User name? The application we use login with a general userid but we would like to register OsUser and AppInfo.

Selecting the @@spid within the events does not result in a "normal" @@spid but in a large number, (1000490334) that increases for every login attempt.

The Database runs on 11.0.1 so I cannot use the ParentConnection property introduced in version 12.0

asked 14 Dec '11, 04:07

Dan%20Jernberg's gravatar image

Dan Jernberg
41226
accept rate: 0%

edited 14 Dec '11, 04:50


Have a look at the EVENT_PARAMETER function. It notes all these context information available within the different system events.

For example, all these connection events you're interested in should give you the APPINFO information of the triggering connection when you query

SELECT EVENT_PARAMETER('APPINFO');

within your event handlers.

Also...

SELECT CONNECTION_PROPERTY ( 
   'whatever-property-you-want', 
   EVENT_PARAMETER ( 'ConnectionID' ) );
permanent link

answered 14 Dec '11, 06:11

Volker%20Barth's gravatar image

Volker Barth
29.6k293444650
accept rate: 32%

edited 14 Dec '11, 07:19

Breck%20Carter's gravatar image

Breck Carter
27.0k424582830

@Breck: Great enhancement!

(14 Dec '11, 07:20) Volker Barth
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×35

question asked: 14 Dec '11, 04:07

question was seen: 1,336 times

last updated: 14 Dec '11, 07:20