Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

SQL Server (6.5) - Logging all queries executed

Posted on 2004-08-20
6
Medium Priority
?
432 Views
Last Modified: 2012-08-14
This one is simple, how can I log all the queries executed in SQL Server 6.5?

If there is no way, is there any way to log queries executed through an ODBC connection? I have was using Ethereal, but I wasn't able to make sense of the captured data.

Discofish
0
Comment
Question by:Discofish
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 9

Expert Comment

by:solution46
ID: 11858032
Discofish,

not sure if it there in 6.5, but have you tried SQL Profiler (definately available in 7 and 2000).

It slows things down a bit, but then I imagine any system of tracking all commands run against SQL Server will to some extent. I haven;t ried using it for large-scale logging, but it is exceptionally good for seeing exactly what SQL Server gets when somebody tries to run a query on it.

If it is available, it should be in Start \ Programs \ Microsoft SQL Server \ Profiler, or you could try looking for profiler.exe in your SQL Server installation folders.

s46.
0
 
LVL 2

Author Comment

by:Discofish
ID: 11865685
I have SQL 6.5, so it doesn't come with that tool.  I didn't see it available for download online anywhere.  Really, all I need to do is capture all queries for a short period of time. So a packet sniffer would be fine, if I could get one that would work.  Some of the monitoring tools I've set up broke other things so they were quickly removed.

Discofish
0
 
LVL 9

Expert Comment

by:solution46
ID: 11865806
bit of a long shot - the application that talks to SQL Server wouldn't happen to use a purpose built connection object (i.e. something you have written to combine the ADO connection and command objects) would it? If so, you could get it to log every call it makes.

Just a thought. Other than that, I'm afraid I can't be of any more help to you but, if I think of anything, I'll let you know.

s46.
0
Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

 
LVL 4

Accepted Solution

by:
chipple earned 2000 total points
ID: 11867401
Back in SQL Server 6.5, SQL Profiler was called SQL Trace, and it did pretty much the same thing. It's part of the client tools so you may have to install it separately using the SQL Server CD.

To use it, you must start up SQL Trace, login to SQL Server and then set up a trace telling it what events you want to log. Especially if you're trying to debug queries that fail, you may want to watch the events called SQL:BatchStarting and/or SQL:StmtStarting for TSQL, and RPC:Starting for stored procedures, which are not selected by default.

Good luck.
0
 
LVL 9

Expert Comment

by:solution46
ID: 11867945
Went digging through my old books last night and found the same thing chipple just said - that application you want is called SQPTrace. If you can't find it on your PC, it is apparently a GUI for an external procedure called xp_sqltrace. I can't help you with the syntax or how to use it, but according to my book xp_sqltrace is pretty well documented in the on-line help. Also, I just checked on the M$ knowledge base and the following link may be helpful (haven;t read through it in detail but it seems to tell you how to use the proc.)

http://support.microsoft.com/default.aspx?scid=kb;en-us;194860&Product=sql

Regards,

s46.
0
 
LVL 2

Author Comment

by:Discofish
ID: 11884196
Thanks for the help folks.  The trace util provied just what I needed.
0

Featured Post

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently I was talking with Tim Sharp, one of my colleagues from our Technical Account Manager team about MongoDB’s scalability. While doing some quick training with some of the Percona team, Tim brought something to my attention...
In this blog post, we’ll look at how ClickHouse performs in a general analytical workload using the star schema benchmark test.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

660 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question