SQL Server Performance

Watching When A Query Runs And Logging It

Discussion in 'Getting Started' started by lcerni, Feb 3, 2009.

  1. lcerni New Member

    I am interested in when the following query runs:
    SELECT table_name.col1,
    table_name.col2,
    table_name.col3,
    table_name.col4,
    table_name.col5,
    table_name.col6,
    table_name.col7,
    table_name.col8
    FROM table_name
    WHERE table_name.col1 = any five digit number here
    How can one trace this? It seems tidious in profiler to do this. I need to watch this query for a week and I do not want to leave profiler on for a week. Can a trigger be created somehow on this and log the five digit number which is what I am interested in? If it can only be done in profiler how do you eliminate the noise.
    This is in SQL Server 2000 SP3.
  2. ndinakar Member

    You can run a server side trace and put a filter to collect events only when the statement is like "%Select...%'. and let it run...

Share This Page