Thorough logging in MS SQL 2000

  • I would like to log every SQL query, success and failure, that hits my

    database. Is this possible?

    Thanks.

     

  • The only method I know of that would allow you to do this and have it readily available to view would be to run a constant SQL Profiler trace that is peared down to only view information you require.  This will, of course, add a level of overhead to your system.  There may be other 3rd party tools that you could use instead of Profiler, but all attempts at doing what you want will add overhead.  I recommend that you do some fairly comprehensive performance testing/benchmarking in a test environment prior to implementing anything of this nature in a production environment.

    John Rowan

    ======================================================
    ======================================================
    Forum Etiquette: How to post data/code on a forum to get the best help[/url] - by Jeff Moden

  • I have a set of stored procedures that define at trace that writes to a file. This is usually used for record SQL for performance problem investigation, but you should be able to modify for your particular needs.

    In the meantime, use SQL Profiler to set up the trace for the events, columns and filters that you need and then use the menu item to pick File --> Save As --> SQL Script.

    The resulting file will then contain the SQL statements to define the events, columns and filters . Then you can replace what exists in the provided sps with your needs.

    SQL = Scarcely Qualifies as a Language

  • Hey thanks guys, that will work. The overhead is temporary, this is a  'boss lost the source code' problem, so I just have to run the trace long enough to see what is being done to the database.

     

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply