Microsoft.SqlServer.Management.Trace.TraceServer - Examples ?

I'm trying to find ANY examples of using the
Microsoft.SqlServer.Management.Trace namespace.

What I'm looking for is an example of being able to create and initialise a
new trace, haing this processed on the Server, and then initializes some
sort of traceReader against this.

e.g the equivalent of:
MyTraceConnection = new Something ("localhost");
MyTrace = new SqlTrace (CaptureTSQL || CaptureLogonEvent ||
CaptureLogoutEvent 0)
MyTrace.Open(MyTraceConnection)

OnTraceEvent (TraceInfo x) {
Console.Writeline ( x.ToString() ) ;
}
Any examples ? There seems to be nothing in MSDN, or SQL2005 info.

Thanks

Steven

[676 byte] By [StevenWilmot] at [2008-2-12]
# 1
Please refer to the SMO samples Tracer and SmoEvents as they create and read trace event logs.
The sample code, if installed in the default folderr, should be in the C:\Program Files\Microsoft SQL Server\90\Samples\Engine\Programmability\SMO\... folder.
TonyGreen at 2007-9-8 > top of Msdn Tech,SQL Server,SQL Server SMO/DMO...
# 2
I installed all subcomponents from the MSDN Download: en_sql_2005_dev_all_dvd.iso

And, I don't have such a folder

Am I missing something ?

StevenWilmot at 2007-9-8 > top of Msdn Tech,SQL Server,SQL Server SMO/DMO...
# 4
The samples are available during the installation of SQL Server but are not automatically installed. If you re-run setup or use Add/Remove Programs you need to go to the Feature Selection and make sure the Sample databases and programs are set to install.

Also, I found the SqlServerSamples.msi on http://www.microsoft.com/downloads/details.aspx?FamilyId=E719ECF7-9F46-4312-AF89-6AD8702E4E6E&displaylang=en about half way down the page.

TonyGreen at 2007-9-8 > top of Msdn Tech,SQL Server,SQL Server SMO/DMO...
# 5
OK - Thanks .

I tried AddRemovePrograms, but didn't find it

However, I've had yet another look at the files from SqlServerSamples.msi, and finally found it...

After I removed the "SignAssembly", the project worked

Though it does seem odd that you can't create a trace against a server, without a .TDF file.

I thought this was what the Microsoft.SqlServer.Management.Smo.ServerTraceEventSet was for, to allow you to define a dynamic trace

StevenWilmot at 2007-9-8 > top of Msdn Tech,SQL Server,SQL Server SMO/DMO...

SQL Server

Site Classified