Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I setup an SQL profiler to run, but I am not seeing any values for updates/inserts. Is there a way to see them?

All I see is stuff like this:

insert into some_tbl(id, col1, col2, col3) values ( @P0 , @P1 , @P2 )

I would love to actually see the values being inserted rather than just a generic variable, but can't seem to figure it out?

share|improve this question
    
I think it's dependant on how you query the database, aka what you're profiling. If I use RPC:Completed, then in TextData I get the query with parameters, and then the parameters specified with value afterwards. –  Allan S. Hansen Feb 19 at 8:22
    
What you're seeing is a parameterized INSERT. –  swasheck Apr 21 at 1:20

2 Answers 2

You can select SQL:StmtStarting and SP:StmtStarting along with SQL:BatchStarting or SP:Starting

enter image description here

Better to use server-side trace rather than using GUI.

share|improve this answer
    
Thank you for the suggestion, but using the settings you posted I got the same result. No values are given, just a bunch of P1, P2, ect –  Luke Robinson Feb 18 at 19:57
    
@LukeRobinson Can you post your insert statements ? Do you want the run time parameters for the variables ? –  Kin Feb 18 at 20:08
    
The original post is pretty much all that I am seeing on update/insert operations, I have no issues with select statements though. I need to see the value of those variables that are being passed into insert/update statements instead of just the variable's name. –  Luke Robinson Feb 18 at 20:16

What you ate setting there is a parametrised insert or more generically use of a "prepared statement" (you will see select statements and others like this too). You might see more specific detail in the "execute prepared SQL" trace option.

If you can't see what you need anywhere in what the profiler can show you, you could try adding a "for insert" trigger to the relevant tables to log the activity, but be very careful about efficiency with this option.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.