views:

205

answers:

2

I wish to implement Sql Server Profiler in a C#/VB.net application. Does anyone have a good example of how to do this? I have searched on Google but didn't find a good working example. I don't have Sql Server Profiler on my system and also don't have Sql Server (it is on a different system).

How do I create Profiler for my self?

+3  A: 

Did you have a look at this post Programmatically receiving profiler events (in real time) from SQL Server 2005 ?

Giorgi
yes but I don't know how to create the trace definition file , as i don't have the sql server profiler on my system, Although I have Sql server management studio but don't have profiler in it, I am using AnjLab Sql Profiler on my system (not the profiler which is integrated with sql server management studio.
Asim Sajjad
A: 

Grab a copy of Profiler on a different machine. Make a trace that you like, then script it using the File menu. Then take that script to your main machine to create your server-side trace.

Rob Farley
Thanks for your comments, But the problem is that I don't have sql server Profile, And can't get it from any where, is there any way to do it without sql server profiler ?????thanks again
Asim Sajjad
Yes, but you need to look up all the trace event codes.
Rob Farley
Lots of info at http://msdn.microsoft.com/en-us/library/ms191006.aspx
Rob Farley