Monitoring views


There's a way to know when a view is accessed and which query is executed in SQL Server 2005/2008?

Thanks for any help.

P.S. Sorry for my english.

more ▼

asked Nov 09, 2009 at 10:50 AM in Default

avatar image

1 1 1 2

(comments are locked)
10|1200 characters needed characters left

1 answer: sort voted first

The best way to monitor what is being used to either set up a custom server-side trace to capture queries as they occur. You can also look at the default trace that's running on the server, but that's only going to have recent data available. Another option is to query the dynamic management function sys.dm_exec_sql_text. That will show you what's been running and is still in cache.

Of the options, a custom server-side trace will give you the most direct control and flexibility. My second choice would be the DMV's.

more ▼

answered Nov 09, 2009 at 11:25 AM

avatar image

Grant Fritchey ♦♦
137k 20 43 81

(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.



asked: Nov 09, 2009 at 10:50 AM

Seen: 915 times

Last Updated: Nov 09, 2009 at 11:58 AM

Copyright 2016 Redgate Software. Privacy Policy