Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

See queries that hit SQL

Tags:

sql

ssms

Is there a way using sql 2008 Management Studio to look at the queries that hit the server? I'm trying to debug a program and I get messages like "Incorrect syntax near the keyword 'AND'". Since the queries are being dynamically generated it's a hassle to figure out what is going to the server.

Any help is appreciated!

like image 332
Shaded Avatar asked Dec 22 '22 02:12

Shaded


2 Answers

There is a tool called Profiler that will tell you all information that you'll need. MSDN: http://msdn.microsoft.com/en-us/library/ms187929.aspx

like image 73
Mike M. Avatar answered Dec 28 '22 11:12

Mike M.


I'm not aware of any method to do this using SQL Server Management Studio, but if you installed SSMS then you probably also installed the SQL Profiler. If you fire that up and run the TSQL_SPs profiler template, you can see every statement that's hitting the database.

like image 34
Aaronaught Avatar answered Dec 28 '22 11:12

Aaronaught