Database Journal
MS SQL Oracle DB2 Access MySQL PostgreSQL Sybase PHP SQL Etc SQL Scripts & Samples Tips Database Forum

» Database Journal Home
» Database Articles
» Database Tutorials
MS Access
SQL Scripts & Samples
» Database Forum
» Slideshows
Free Newsletters:

News Via RSS Feed

Database Journal |DBA Support |SQLCourse |SQLCourse2

Featured Database Articles


Posted Apr 9, 2000

Using SQL Server Profiler - Page 2

By Andrew Wiegand

After selecting the trace name and server we will want to specify some filters for our trace. The sproc I'm developing archives 6 tables in the database. Therefore I will want to filter the trace to only capture SQL executed against those tables. I open up "Trace Properties" click on the Filters tab. Then scroll down to the Text key and enter the following in the Include field: %<table 1 name>%;%<table 2 name>%;%<table nname>%;

Figure 2.     Trace Properties dialog filtering by table name

Then I save the trace definition. You will want to be cautious when filtering by table. If there was a primary key - foreign key relationship defined between one of the tables I included in the trace and another table I excluded I could encounter SQL errors when replaying my trace. In my case, there is no pk-fk constraint defined so I am safe. Now our trace will only capture SQL executed against the tables we entered above. After specifying the filter our trace is ready to be executed against the production server. However, we will want to keep in mind the time that my new sproc will run. In order to minimize load on the server it was decided to install the sproc at 12:00 AM. Since installation occurs at 12:00 AM we will want to ensure that our SQL trace captures activity on the production server during the same time. So we've waited around until midnight and now we can start the trace capture. We should let the trace run for at least the length of time that I estimate the new sproc will run which is, in this case, 5 hours. After 5 hours of running we stop the trace (click on the Red square) and save the trace file (select Save As-Trace File from the File menu).

MS SQL Archives

Comment and Contribute


(Maximum characters: 1200). You have characters left.



Latest Forum Threads
MS SQL Forum
Topic By Replies Updated
SQL 2005: SSIS: Error using SQL Server credentials poverty 3 August 17th, 07:43 AM
Need help changing table contents nkawtg 1 August 17th, 03:02 AM
SQL Server Memory confifuration bhosalenarayan 2 August 14th, 05:33 AM
SQL Server Primary Key and a Unique Key katty.jonh 2 July 25th, 10:36 AM