-
Notifications
You must be signed in to change notification settings - Fork 330
Is there a way to associate an InfoMessage event with a specific SqlCommand? #3021
-
When receiving information from PRINT or informational RAISERROR statements, there doesn't seem to be a way to tie them back to a specific SqlCommand, as the InfoMessage event is on the SqlConnection, not the SqlCommand, and the SqlInfoMessageEventArgs instance doesn't appear to contain any information identifying the SqlCommand.
Frustratingly, it does look like the SqlCommand instance is passed to the FireInfoMessageEvent method, so to my layman's eye it seems like the information isn't that far away from the creation of the SqlInfoMessageEventArgs instance.
Anyway, is there any way to identify which SqlCommand a message came from?
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 1 comment
-
This does seem like an oversight. We will investigate further, and if appropriate, come up with an API proposal.
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 1