March 13, 2014 at 1:02 pm
nope, I've nearly got it - thanks again for all your help
I'll post it when done, removing the PRINTs, sundry SELECTs of table variables, etc
March 13, 2014 at 1:25 pm
Seggerman-675349 (3/13/2014)
nope, I've nearly got it - thanks again for all your helpI'll post it when done, removing the PRINTs, sundry SELECTs of table variables, etc
You are quite welcome although I think the only help you received from was apparently becoming a muse. My posts were all just asking for details so I had an idea of what you are trying to do. I still have no idea what the actual code is supposed to do. I am glad you figured it out.
_______________________________________________________________
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 14, 2014 at 5:21 am
here's the new proc - it ran the night before in 88 minutes
last night it took 4 minutes:w00t:
legal told me to take it down:(
March 14, 2014 at 7:11 am
That looks better but you still have RBAR in there. You have a while loop that is still running but going from 88 minutes to 4 is a vast improvement. 😀
_______________________________________________________________
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 15, 2014 at 7:28 am
You might want to consider replacing all of those table variables with temp tables. The results may surprise you.
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
Viewing 5 posts - 16 through 19 (of 19 total)
You must be logged in to reply to this topic. Login to reply