November 20, 2008 at 7:59 am
Thanks longobardia,
I think he found it 2 posts back. I'm trying to get into the habit of helping people who are new to SQL with finding the problems/solutions themselves with a bit of guidance rather than just blindly giving the answer 🙂
----------------------------------------------
Try to learn something about everything and everything about something. - Thomas Henry Huxley
:w00t:
Posting Best Practices[/url]
Numbers / Tally Tables[/url]
November 20, 2008 at 6:43 pm
longobardia (11/20/2008)
Chris,I couldn't bare the pain any longer reading your suggestions.
Let me give hime the answer:
SELECT T1.ObjectID FROM....
SELECT T2.ObjectID FROM ....
see below:
IF EXISTS(SELECT T1.ObjectID FROM @tmp_subjects t1
INNER JOIN tkObjects o ON t1.ObjectID=o.ObjectID
IF EXISTS(SELECT T2.ObjectID FROM @tmp_objects t2
INNER JOIN tkObjects o ON t2.ObjectID=o.ObjectID
Heh... and, yet, you're ok with all the RBAR calling a single row proc in the earlier post. 😉
--Jeff Moden
Change is inevitable... Change for the better is not.
November 20, 2008 at 8:09 pm
I have to agree with Jeff. Keep the temporary tables and figure out how to get rid of the RBAR in your code. It's all the looping that is making your procedures slow, not the temporary tables. There may be a set-based solution to your problem, but nobody has tried to find it.
We don't have enough information to work on it either. We would need the DDL for all the user defined tables in the procedure, sample data for the tables, the expected results from executing the procedure.
Read the article in my signature block on asking for help for more information.
Viewing 3 posts - 16 through 17 (of 17 total)
You must be logged in to reply to this topic. Login to reply