SQL Server General Log?

Banana

split with a cherry atop.
Local time
Today, 13:04
Joined
Sep 1, 2005
Messages
6,318
I think this is a case of me not knowing the correct name or keyword to search. I'm looking for a way to get a log that reads all statements sent to SQL Server, primarily for debugging information. Transaction logs, which keep cropping up in my search, isn't correct because it only stores modifications (UPDATE/DELETE/INSERT) but not SELECTs. Couldn't find anything apropos in the Profiler.

If someone can tell me where it is or what it is called, I'll be much obliged and figure out the rest. :)
 
Hi Banana,

I know that Enterprise Manager (under Management) displays the last SQL
command that every process has issued. It must store it in a table in the
Master database.

But I'd be very, very surprised if it maintained a history though. You might
have to write something to continuously grab the contents of whatever table that is.

Given that SQL commands can come from many diverse sources; Linked tables,
Query Analyzer sessions, ADO connections, Enterprise, Batch Jobs.

That's an overwhelming amount of SQL to collect.

Just some thoughts,
Wayne
 
I don't expect it to keep history for production; as I said it's mainly for debugging. I did same thing with MySQL, to help me watch how Access formed the queries and sent it off.

Nonetheless, thanks for the lead; I'll look into this.
 
FYI for anyone who may stumble upon this thread-

this was in fact in SQL Server Profiler, but I had missed the first time; when it starts up, there's a template of trace in a drop down list to choose from. Select T-SQL will give you all SQL statements sent to the server.

Wayne, thanks again! :)
 

Users who are viewing this thread

Back
Top Bottom