October 4, 2011 at 2:13 pm
Sean,
Can you please take a look at my SP, the challenge is right at (@StartYear IS NULL AND @EndYear IS NULL)) where I need to pass in null params and still get the result set.
I appreciate your time.
October 4, 2011 at 2:24 pm
ramadesai108 (10/4/2011)
Sean,Can you please take a look at my SP, the challenge is right at (@StartYear IS NULL AND @EndYear IS NULL)) where I need to pass in null params and still get the result set.
I appreciate your time.
WOW are those your REAL table names??? It is pretty tough to tell what is going on without some ddl. What datatypes are your year fields?
Why join tbl2 to tbl2 on the same field.
My guess is you have some serious parameter sniffing going on too...http://sqlinthewild.co.za/index.php/2007/11/27/parameter-sniffing/[/url]
If you want real help post up some ddl and sample data (insert statements) and desired output. That will get you some tested code that is fast.
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
October 4, 2011 at 3:01 pm
Thanks all for your time. I have now resolved the issue but just facing one more issue of case when in where. Hopefully I will resolve it soon. Again, thanks for your help.
October 4, 2011 at 3:06 pm
ramadesai108 (10/4/2011)
Thanks all for your time. I have now resolved the issue but just facing one more issue of case when in where. Hopefully I will resolve it soon. Again, thanks for your help.
You're welcome. Feel free to post back if you need some help with your case statement.
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
March 3, 2014 at 5:17 pm
REPLACE(@DefaultValue, ',',''',''')
@DefaultValue = '''' + @DefaultValue + ''''
March 4, 2014 at 7:11 am
bikrant.sharma (3/3/2014)
REPLACE(@DefaultValue, ',',''',''')@DefaultValue = '''' + @DefaultValue + ''''
That doesn't help with a parameter. That is why you have to parse it. Read through the responses in this thread.
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
Viewing 6 posts - 16 through 20 (of 20 total)
You must be logged in to reply to this topic. Login to reply