Home All Groups Group Topic Archive Search About
Author
27 Nov 2007 8:24 PM
A. Robinson
I'm looknig for a way to implement a particular filter on a SQL trace nad
haven't been able to find a method - perhaps someone here has been
successful...

I'd like to filter out particular DDL statements from my trace. I want to
keep any DDL that creates a TEMP table, but filter out any DDL to create
stored procedures and "real" tables. I'd also like to filter out system type
activities (i.e. setting transaction isolation levels, db options, etc.)

I know I could do a bunch of singleton where TEXTDATA is NOT LIKE.... but is
there an easier "one stop" way to accomplish this?

Thanks!!

Author
27 Nov 2007 11:10 PM
Erland Sommarskog
A. Robinson (ARobin***@discussions.microsoft.com) writes:
> I'd like to filter out particular DDL statements from my trace. I want
> to keep any DDL that creates a TEMP table, but filter out any DDL to
> create stored procedures and "real" tables. I'd also like to filter out
> system type activities (i.e. setting transaction isolation levels, db
> options, etc.)
>
> I know I could do a bunch of singleton where TEXTDATA is NOT LIKE....
> but is there an easier "one stop" way to accomplish this?

It's not as easy as it looks. There are two problems:
1) There are no regular expressions.
2) CREATE PROCEDURE could include creation of temp tables.

But maybe you can use the Object:Created events?

--
Erland Sommarskog, SQL Server MVP, esq***@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

AddThis Social Bookmark Button