| Author |
Topic |
|
yalgaar
Starting Member
43 Posts |
Posted - 2006-03-06 : 14:42:22
|
| I have an application that uses SQL server. Is there a way to find out what SQL statements the application is passing to the SQL server?I would like to know all kinds of activities going on in the background of the application. I am sure there is a way.Thanks in advance. |
|
|
JoeNak
Constraint Violating Yak Guru
292 Posts |
Posted - 2006-03-06 : 14:45:55
|
| You can run a trace with Profiler. |
 |
|
|
yalgaar
Starting Member
43 Posts |
Posted - 2006-03-06 : 14:48:51
|
| Can you please provide more details on that?Thanks |
 |
|
|
JoeNak
Constraint Violating Yak Guru
292 Posts |
|
|
yalgaar
Starting Member
43 Posts |
Posted - 2006-03-06 : 15:06:38
|
| Since I do not got the response that I am looking for, I will be more specific:Is there any SQL logs that matains everything that was done on the server on each table, each database? I need information of all SQL statements that were ran on the SQL server?Is this available in any files or do I have to turn ON something? |
 |
|
|
JoeNak
Constraint Violating Yak Guru
292 Posts |
Posted - 2006-03-06 : 15:12:28
|
| You have to have a trace running and you will only be able to see activity from when you start the trace. The only other thing I can come up with is to look through the transaction logs, but you need a third party application to read the transaction logs. |
 |
|
|
yalgaar
Starting Member
43 Posts |
Posted - 2006-03-06 : 15:44:26
|
| I followed the instructions in the link. It seems I may not be doing something correctly, but currently I am getting a huge amount of data in the trace table. Is there a way that I can get only the SQL statements? |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2006-03-06 : 15:48:07
|
| I typically only add Stored Procedures: SP:StmtCompleted and T-SQL: SQL:StmtCompleted. That should narrow it down for you.Tara Kizeraka tduggan |
 |
|
|
JoeNak
Constraint Violating Yak Guru
292 Posts |
Posted - 2006-03-06 : 16:01:32
|
| nevermind. |
 |
|
|
yalgaar
Starting Member
43 Posts |
Posted - 2006-03-06 : 16:09:11
|
quote: Originally posted by tkizer I typically only add Stored Procedures: SP:StmtCompleted and T-SQL: SQL:StmtCompleted. That should narrow it down for you.Tara Kizeraka tduggan
My application requests several queries. I just want to see Select statements. Can this be done? |
 |
|
|
JoeNak
Constraint Violating Yak Guru
292 Posts |
Posted - 2006-03-06 : 16:19:22
|
| Yes, profiler lets you filter on a variety of criteria. The statement can be filtered by TextData. You could also filter by application, login... |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2006-03-06 : 16:39:42
|
| I prefer not to filter unless it is by loginame or hostname. Trace the data to a SQL Server Table. Then you can use T-SQL to view what you want to see. Such as:SELECT TextDataFROM YourTraceTableNameWHERE TextData LIKE '%SELECT%'Tara Kizeraka tduggan |
 |
|
|
|