June 4, 2010 at 11:16 am
June 4, 2010 at 12:19 pm
I'm working on refactoring and implementing as such. I will let you guys know of my results when doing so. Sorry for the delayed responses, but have some other things that are currently taking precedence.
June 4, 2010 at 12:36 pm
That worked! I got the same results that I initially had from using the while the loop and iterating over the temp tables.
June 4, 2010 at 2:43 pm
Very cool. Thanks for the feedback, Dan.
--Jeff Moden
Change is inevitable... Change for the better is not.
June 4, 2010 at 3:17 pm
No thank you and everyone else for the insight. There's always more than one way to do something, but at the end of the day make sure that it's done in the best possible way. Once again thanks.
June 4, 2010 at 6:34 pm
John Rowan (6/4/2010)
In fact, since your Table A will only ever hold one value (since you are not getting this from a table in the DB, but from the @ID parameter), you don't even need that table. You can run a simple SELECT against your tblSomeType to get your results. This will make your solution SET based (no cursors) and remove the overhead of the temp tables.
John, I assumed that TableA was being inserted into from another table, and could have multiple rows. I figured he just threw that simple insert in to give some test data.
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
Viewing 6 posts - 16 through 20 (of 20 total)
You must be logged in to reply to this topic. Login to reply