exclude columns for SQL Server 2005 trace

I'm creating a scheduled serverside trace for a SQL Server 2005 machine. I'd like to exclude the BinaryData/2 column for the SQL:StmtCompleted/41 event.

Here's a reference to what I'm talking about:
http://msdn.microsoft.com/en-us/library/ms186265%28v=sql.90%29.aspx

The following code does not filter out the above. Can you please explain what is wrong or show another approach?

/***********************************************/
/* Server Side Trace                           */
/***********************************************/
-- Declare variables
DECLARE @rc INT
DECLARE @TraceID INT
DECLARE @maxFileSize bigint
DECLARE @fileName NVARCHAR(128)
DECLARE  @on bit
DECLARE @off bit

-- Set values
SET @maxFileSize = 5
SET @fileName = N'C:\TestTrace'
SET  @on=1
SET @off=0

-- Create trace
EXEC @rc = sp_trace_create @TraceID output, 0, @fileName, @maxFileSize, NULL  

-- If error end process
IF (@rc != 0) GOTO error

-- Set the events and data to collect
EXEC sp_trace_setevent @TraceID, 41, 14, @on
EXEC sp_trace_setevent @TraceID, 41, 15, @on
EXEC sp_trace_setevent @TraceID, 41, 16, @on
EXEC sp_trace_setevent @TraceID, 41, 17, @on
EXEC sp_trace_setevent @TraceID, 41,  2, @off

-- Start the trace
EXEC sp_trace_setstatus @TraceID, 1
 
-- display trace id for future references  
SELECT TraceID=@TraceID  
GOTO finish  

-- error trap
error:  
SELECT ErrorCode=@rc  

-- exit
finish:
GO

In essence, I want to run a serverside trace and I want to exclude particular columns for whatever events I choose. I do not want to use the GUI though.

Thanks!

pae2
pae2Asked:
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.

Eugene ZCommented:
try to exclude\comment this column

--EXEC sp_trace_setevent @TraceID, 41,  2, @off
0
pae2Author Commented:
I already have that in my code. Does anyone else have any ideas?
0
Eugene ZCommented:
<I already have that in my code>
can you remove this from you code?
and post result
0
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

pae2Author Commented:
I tried that already too. It seems all columns are returned by default. That's what I'm trying to alter. I want to exclude some of them. Any ideas?
0
Eugene ZCommented:
please post your sql 2005 server version edition
make sure it has latest sql sp (4)
0
Eugene ZCommented:
try
EXEC sp_trace_setevent @TraceID, 41,  2, 0
0
pae2Author Commented:
I'm going to have to try this later today. I'll get back to you. Thanks!
0
Eugene ZCommented:
try to generate the script via sql profiler - try to run this trace from GUI and see if the output file is ok
safe the script and use from ssms \job
0
pae2Author Commented:
None of these worked. I stopped trying after the 2013-09-20 at 09:33:36 post.
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
Eugene ZCommented:
you should really try the posted solutions after the 2013-09-20 at 09:33:36 post.
0
pae2Author Commented:
Nothing worked with the answers provided.
0
Eugene ZCommented:
so you did not try the posted solutions after the 2013-09-20 at 09:33:36 post?
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 2008

From novice to tech pro — start learning today.