Microsoft SQL Server provides Transact-SQL system stored procedures to create ... applications to create traces manually, instead of using SQL Server Profiler.
technet.microsoft.com