Profiler - what's passed to variables

  • I'm new to profiler so this may be a very easy question. I've used the tool to see what TSQL code hits a server. I now have a requirement to see the TSQL code and values passed to the variables in the code at the time it's run....so I guess it's the actual script value? This can be done in MYSQL, and I'm hoping I can do it in MSSQL. Any ideas? Thanks!

  • The actual "start" values are mostly in the RPC starting and SQL Batch starting events.

  • All I see in the start value is the name of the variable (i.e. @cost). The requirement is to be able to see what value is actually passed in as @number during the query execution (i.e. 5098) so here is a small example of query:

    DECLARE @cost varchar(10)

    DECLARE @price varchar(10)

    set @cost = itemtable.itemcost

    set @price = ordertable.itemprice

    SELECT * from

    ordertable.itemnumber order

    join itemtable item

    on order.itemnumber=item.itemnumber

    WHERE @cost > @price

    but would like to see:

    WHERE 5098>6000

    This is for code debugging purposes. Perhaps profiler isn't even the correct tool? Any ideas on other tools that could provide this information? Thanks!!

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply