dbTalk Databases Forums  

Re: Viewing events as they happen?

comp.databases.ms-sqlserver comp.databases.ms-sqlserver


Discuss Re: Viewing events as they happen? in the comp.databases.ms-sqlserver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Robert Klemme
 
Posts: n/a

Default Re: Viewing events as they happen? - 03-05-2007 , 05:11 AM






On 05.03.2007 11:31, Dylan Parry wrote:
Quote:
I am trying to debug some queries that are being generated by an
external program, and I have no way of finding out what the actual
syntax of the query is from within the program itself. This means that
when the query fails I am left with only a very unhelpful message.

So what I was wondering, was whether there is a way that I can view the
actual queries that are sent to SQL server as they happen, or if a
real-time solution doesn't exist, then some way I can look back after
the event and see the syntax of the queries?

Ideally, what I would like to do is see the queries in the form they
were sent to the server, ie "SELECT * FROM foo WHERE bar='foobar'", as
this would help me to figure out where the generated queries are going
wrong.
SQL Profiler is your friend - for online as well as offline
investigation. You can even have it include execution plans and timings.

Kind regards

robert

F'Up comp.databases.ms-sqlserver


Reply With Quote
  #2  
Old   
Uri Dimant
 
Posts: n/a

Default Re: Viewing events as they happen? - 03-05-2007 , 05:21 AM






Dylan
Take a look at SQL Server Profiler to capture those events



"Dylan Parry" <usenet (AT) dylanparry (DOT) com> wrote

Quote:
Hi,

I am trying to debug some queries that are being generated by an
external program, and I have no way of finding out what the actual
syntax of the query is from within the program itself. This means that
when the query fails I am left with only a very unhelpful message.

So what I was wondering, was whether there is a way that I can view the
actual queries that are sent to SQL server as they happen, or if a
real-time solution doesn't exist, then some way I can look back after
the event and see the syntax of the queries?

Ideally, what I would like to do is see the queries in the form they
were sent to the server, ie "SELECT * FROM foo WHERE bar='foobar'", as
this would help me to figure out where the generated queries are going
wrong.

Cheers,

--
Dylan Parry
http://electricfreedom.org | http://webpageworkshop.co.uk

The opinions stated above are not necessarily representative of
those of my cats. All opinions expressed are entirely your own.



Reply With Quote
  #3  
Old   
Jack Vamvas
 
Posts: n/a

Default Re: Viewing events as they happen? - 03-05-2007 , 07:15 AM



If you have loads of activity on the server, use the filter function when
you set up a Trace to only view activity from the dab you are focusing on

--

Jack Vamvas
___________________________________
The latest IT jobs - www.ITjobfeed.com
<a href="http://www.itjobfeed.com">UK IT Jobs</a>


"Dylan Parry" <usenet (AT) dylanparry (DOT) com> wrote

Quote:
Dylan Parry wrote:
[...]

Thanks to both of you that replied. I'll take a look at Profiler

--
Dylan Parry
http://electricfreedom.org | http://webpageworkshop.co.uk

The opinions stated above are not necessarily representative of
those of my cats. All opinions expressed are entirely your own.



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.