Can SQL Profiler catch the trace

  • Hi

    I am wondering for; Will SQL Profiler will capture trace for the hard coded

    query in application.

    Answers will be thankfull.

    Ali
    MCTS SQL Server2k8

  • Ali Tailor (9/6/2012)


    Hi

    I am wondering for; Will SQL Profiler will capture trace for the hard coded

    query in application.

    Answers will be thankfull.

    a profiler session or a server side trace can catch all commands hitting the server, regardless of the source/application that is calling them.

    The events I typically capture are SQL:BatchCompleted, which is SQL commands and RPC:Completed , which are calls to execute stored procedures.

    this is a decent server side DML trace model I put together, if you think it can help:

    trace_DML_model.txt

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • M

    Lowell (9/6/2012)


    Ali Tailor (9/6/2012)


    Hi

    I am wondering for; Will SQL Profiler will capture trace for the hard coded

    query in application.

    Answers will be thankfull.

    a profiler session or a server side trace can catch all commands hitting the server, regardless of the source/application that is calling them.

    The events I typically capture are SQL:BatchCompleted, which is SQL commands and RPC:Completed , which are calls to execute stored procedures.

    this is a decent server side DML trace model I put together, if you think it can help

    trace_DML_model.txt

    Thank you very much Lowell for you prompt & Detail reply.

    Thanks a lot for attached script.

    Ali
    MCTS SQL Server2k8

  • glad I could help Ali;

    pay attention to the code at the bottom, which is creating a VIEW named sp_MyTrace so you can query the trace any time, with a simple query:

    little details like that makes working with traces incredibly easy.

    SELECT * FROM sp_MyTrace

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

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

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