Monitoring SQL views using SQL Profiler

  • Seems that having SQL Profiler display when views are called and how long they take to run (duration) would be a simple thing to set up.  Can't seem to find the proper Filters and/or Events to do the job though.

     

  • filter by dbid , eliminate sql agent and any monitoring tools you have.

    Choose sql batch as the event

    if your views all start with a common prefix or have a common suffix or you don't have too many then use a filter in the text column to only get what you want .. e.g. where text like '%view%' where all your views are called dbo.view_xxxxxxx

    Otherwise collect the data, port it into a table and use a select to extract from a lookup table of view names, which you can create by querying sysobjects.

    I find profiler great but sometimes I wish there were other "bits". sometimes naming all your views vw_xxxx can have it's advantages < grin >

    [font="Comic Sans MS"]The GrumpyOldDBA[/font]
    www.grumpyolddba.co.uk
    http://sqlblogcasts.com/blogs/grumpyolddba/

  • Thanks for the quick reply.  The Profile is running and I'm getting some interesting results.

    Thanks again.

     

  • this came in handy too...

    Object Type Filter Values for SQL Server Profiler
    Filter ValueObject Type
    1Index
    2Database
    3User Object
    4CHECK Constraint
    5Default or DEFAULT Constraint
    6FOREIGN KEY Constraint
    7PRIMARY KEY Constraint
    8Stored Procedure
    9User-Defined Function (UDF)
    10Rule
    11Replication Filter Stored Procedure
    12System Table
    13Trigger
    14Inline Function
    15Table Valued UDF
    16UNIQUE Constraint
    17User Table
    18View
    19Extended Stored Procedure
    20Ad hoc Query
    21Prepared Query

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

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