February 18, 2010 at 6:25 pm
This is still going to give you trouble:
And (tEx.EventResults LIKE %)
needs to be
And (tEx.EventResults LIKE '%')
at very least
----------------------------------------------------------------------------------
Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?
February 18, 2010 at 6:38 pm
Maybe I'm just not looking deep enough but does anyone actually see anything in the dynamic SQL that actually requires it to be dynamic?
--Jeff Moden
Change is inevitable... Change for the better is not.
February 18, 2010 at 10:37 pm
You are right Jeff. Even i don't think the query needs to be dynamic. Making it simple might solve the whole problem.
How to post data/code on a forum to get the best help - Jeff Moden
http://www.sqlservercentral.com/articles/Best+Practices/61537/
February 19, 2010 at 10:34 pm
Though it does seem to me that what this is really supposed to do is to just drop the NULL-valued clauses completely from the dynamic sql, rather than executing them, which probably would make it perform better.
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
February 22, 2010 at 12:16 pm
I simplified the stored procedure and it works now.
Thank you all for your help.
February 22, 2010 at 12:25 pm
Glad we could help.
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
Viewing 6 posts - 16 through 20 (of 20 total)
You must be logged in to reply to this topic. Login to reply