question

chiknkoop avatar image
chiknkoop asked

Capturing a table valued parameter in XE session

Background, we're getting performance issues on this stored proc (that I didn't write). The proc: 1. Is passed two variables, an id (int) and a table-type variable 2. It updates a table, changing the sort order in rows matching the table variable and the ID param, then 3. Inserts the rows that aren't there already To troubleshoot it, I want to capture the contents of the table type variable in an extended events session. My current XE session captures: 1. the rpc_completed (filtered on the name of the stored proc I'm calling, "DocumentComponentVariables") event 2. the sp_statement_completed (where the statement contains the word "document") 3. the qn_parameter_table (no filter) events, but it looks like I'm only capturing the scalar parameters. But I don't see anything about what's in the table variable passed into the proc, just the order id param. Are these the right events to use? Do I need to add other columns or something? Or is this harder than it seems?
extended-events
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
satishseth143 avatar image
satishseth143 answered
Instead of using extended events, can you just write a select into statement inside the stored procedure to look at the data.
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

chiknkoop avatar image chiknkoop commented ·
I'll probably have to end up doing something like that... I'm curious to see if someone knows of a way to do this, though.
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.