Is there a way to associate an InfoMessage event with a specific SqlCommand? #3021
Unanswered
Metritutus
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When receiving information from
PRINT
or informationalRAISERROR
statements, there doesn't seem to be a way to tie them back to a specificSqlCommand
, as theInfoMessage
event is on theSqlConnection
, not theSqlCommand
, and theSqlInfoMessageEventArgs
instance doesn't appear to contain any information identifying theSqlCommand
.Frustratingly, it does look like the
SqlCommand
instance is passed to theFireInfoMessageEvent
method, so to my layman's eye it seems like the information isn't that far away from the creation of theSqlInfoMessageEventArgs
instance.Anyway, is there any way to identify which
SqlCommand
a message came from?Beta Was this translation helpful? Give feedback.
All reactions