Red Gate forums :: View topic - Long Running Query Alert - What Does It Capture
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Monitor 4
SQL Monitor 4 forum

Long Running Query Alert - What Does It Capture

Search in SQL Monitor 4 forum
Post new topic   Reply to topic
Jump to:  
Author Message
EdCarden



Joined: 25 Nov 2008
Posts: 90

PostPosted: Thu Mar 27, 2014 7:28 pm    Post subject: Long Running Query Alert - What Does It Capture Reply with quote

WHy does the LRQ (Long Running Query) alert sometimes capture the actual T-SQL code as shown in #1 below and at other times captures the sturcture and not the values as shown in #2 below? The second one does not show you the actual values being inserted.

#1:
INSERT INTO [dbo].[MYTABLE]( @col1, @col2, @colN)
VALUES (1, 'a', 'WhatThe')

#2:
(@1 int,@2 varchar(1),@3 varchar(256) ) INSERT INTO [MYTABLE]( @col1, @col2, @colN)
VALUES (@1, @2, @3)
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6674

PostPosted: Mon Mar 31, 2014 2:20 pm    Post subject: Reply with quote

I have noticed that sometimes running queries results in a parameterized query being submitted behind the scenes. You can see the same behavior if you run a MS SQL Profiler session against the database. Particularly, I think ODBC connections (as opposed to connections that use the native MSSQL driver) transform the simple version of the query into one with parameters.

Hope this helps.
Back to top
View user's profile Send private message
EdCarden



Joined: 25 Nov 2008
Posts: 90

PostPosted: Mon Apr 14, 2014 7:18 pm    Post subject: Re: Reply with quote

Brian Donahue wrote:
I have noticed that sometimes running queries results in a parameterized query being submitted behind the scenes. You can see the same behavior if you run a MS SQL Profiler session against the database. Particularly, I think ODBC connections (as opposed to connections that use the native MSSQL driver) transform the simple version of the query into one with parameters.

Hope this helps.


Brian,

If the client were using ado.net insetad of ODBC would help? Do you know if there is anything that can be done at the SQL Server end to change this or is this just one of those things you're stuck with?


Thanks
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6674

PostPosted: Tue Apr 15, 2014 10:31 am    Post subject: Reply with quote

It's the way that the client works. I do not know enough about the internals of SQL native client and/or ADO to say how to avoid it.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group