I am wanting to use SQL Profiler to log all requests to a database and store
them in another database for later auditing of duration and CPU usage.
I can manually setup a SQL Profiler trace and have it write to a table. But
how do I script this so that I can say start this process by using a Stored
Is that the best way to start the trace? from the stored procedure?
I have used the [File]-[Script Trace] option but it only wants to write to a
Here is part of that file:
-- Please replace the text InsertFileNameHere, with an appropriate
-- filename prefixed by a path, e.g., c:\MyFolder\MyTrace. The .trc
-- will be appended to the filename automatically. If you are writing from
-- remote server to local drive, please use UNC path and make sure server
-- write access to your network share
-- Client side File and Table cannot be scripted
-- Writing to a table is not supported through the SP's
What does the line above really mean? Why is it not supported? I suppose I
can use BULK IMPORT to import the file?
If I use the file how do I start the trace? What actually happens when the
script is run? I see it creates a file but the file remains 0 bytes long.
Any help would be appreciated