SQL Profiler Works in Sql Server
How to determine what queries need indexing?
- WAY 1: By Create trace
- WAY 2: Using SQL Profiler
Using SQL Profiler- Primary purpose of SQL profiler is to capture all activity based against the SQL database, SQL Server itself.
Right down you queries on new query window that want to TRANCE
Activate SQL Profiler
Connect window will appear, connect it
- Trace Property window appear
- Go to Event selection tab and uncheck most of the options except following
- TextData
- ApplicationName
- SPID
- Click show all columns checkbox
- and choose all checkbox of Database name Column
- uncheck all columns checkbox. Our final out come like below
- Click Column filters button will open a popup and filter by database name
- To run Traces only for this database, rather than running against every single database
- Go to Event selection tab and uncheck most of the options except following
- Run to record your Traces
- Click Run Button
Execute you above Queries
- Run Execute in your Query Window. No SQL Profiler will trace query in query window
WHY Traces
Run it and the trace has begun, meaning it's ready to detect anything that connects to it and any SQL queries
Once everything traced, click stop trace button
Click on specific trance to see trace detail in bottom section
Save your Traces for later Use
- D:\NotesCollections