SQL Profiler

I am trying to look at a performance issue within SQL and need to be able to monitor what tables are being opened within SQL at a given time , I have been using SQL Profiler but cant seem to work out how I can get a list of tables being opened at a certain time , I need to basically run a test on my database and at a certain point start the profiler and then list just what tables are being opened then stop SQL Profiler , Anyone any ideas on how I can do this , I will want to capture the list over about a 15 min time period
mcsglobalAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Vitor MontalvãoMSSQL Senior EngineerCommented:
You can use this code to check which table was accessed during the last 15 minutes (you can change the time period of course):
USE DatabaseName
GO

SELECT OBJECT_NAME(object_id) ObjName, last_user_seek, last_user_scan, last_user_update
FROM sys.dm_db_index_usage_stats
WHERE database_id=DB_ID()
	AND (last_user_seek >= DATEADD(minute, -15, GETDATE())
			OR last_user_scan >= DATEADD(minute, -15, GETDATE())
			OR last_user_update >= DATEADD(minute, -15, GETDATE()))

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mcsglobalAuthor Commented:
Thankyou Vitor ,

I was thinking it needed to be more complicated than that but it gives us what we needed

Thankyou
0
Vitor MontalvãoMSSQL Senior EngineerCommented:
Keep it simple ;)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.