Solved

SQL Server (6.5) - Logging all queries executed

Posted on 2004-08-20
6
397 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
  • 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
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
LVL 4

Accepted Solution

by:
chipple earned 500 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

I guess that all of us know that caching the data usually increase the performance, but I worried if all of us are aware about the risk that caching the data provides and how to minimize this.  That’s the reason why I decided to write this short art…
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

911 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now