April 11, 2016 at 2:44 pm
hi,
how to capture all SQL Statements Hitting the database of server.
is this any script is available for this
thanks
Divya
April 12, 2016 at 3:48 am
This is possible using extended events, server side trace or SQL server profiler.
If your new to this SQL server profiler is the easiest way but i will mention that you should never use this against a production server, I'll leave you to re-search why.
Server side trace and profiler are detailed in this blog post which will get you started:
https://www.mssqltips.com/sqlservertutorial/272/profiler-and-server-side-traces/
Extended events are less resource intensive but also much harder to setup especially if your not familiar:
https://msdn.microsoft.com/en-us/library/bb630282.aspx
MCITP SQL 2005, MCSA SQL 2012
April 12, 2016 at 6:08 am
Least cost to do this is extended events. However, since you're in 2008, there is no GUI for consuming the results (or setting things up). You'll need to query XML to see the results. There are lots of examples online of how to do this though, so it shouldn't be that difficult.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply