Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Profiler oddity

Status
Not open for further replies.

LFCfan

Programmer
Nov 29, 2002
3,015
GB
I was running a trace (Sql Server 2005), and noticed that when a particular stored proc is executed, that takes two smalldatetime parameters, the execution statement shown by Profiler was

Code:
exec dbo.GetAvailableDates @start=''2008-10-01 00:00:00:000'',@end=''2008-10-31 00:00:00:000''

... with the two single quotes at each end of the parameter values.

I don't see how they got there, or how this statement is being executed without erroring, if that is indeed the actual statement being executed!

Anyone seen anything like this before?

The execution is kicked off from and ASP.NET 2.0 application, with parameters being added as
Code:
 db.AddInParameter(dbc, "@start", DbType.DateTime, startDate);
using the MS Enterprise Library classes.

Any thoughts would be much appreciated!


~LFCfan

 
When SQL executes this stuff, it sometimes sees it an dynamic SQL that needs to be executed, hence the double quotes.

On profiler is just being weird and showing you two quotes for no reason. Can't say for sure.

Denny
MVP
MCSA (2003) / MCDBA (SQL 2000)
MCTS (SQL 2005 / Microsoft Windows SharePoint Services 3.0: Configuration / Microsoft Office SharePoint Server 2007: Configuration)
MCITP Database Administrator (SQL 2005) / Database Developer (SQL 2005)

My Blog
 
Thanks Mr Denny.
I'll just put it down to weirdness as the query seems to be executing fine!

~LFCfan

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top