Re: Can I avoid temp tables, etc.
- From: Rich P <rpng123@xxxxxxx>
- Date: 14 Sep 2006 21:27:10 GMT
On your sample SPs you don't show
Set NOCOUNT ON
If you add that to your procs you should see an improvement on
performance because the SP won't be wasting time counting rows to return
and return a count.
As for the tempt tables, wherever you are createing a temp table - just
convert that to a subquery. The temp table is usually a list you are
comparing against for Exists/Not Exits. Well, at least if you are,
for those temp tables, you can convert them to subqueries. This should
improve performance a little because you won't be using resources to
create a table.
All you have to do to make the temp table a subquery is wherever you
have
Create Procedure sp_...
as
Insert Into .....
just grab the Insert Into ... code and change it to
Where Exits
(Select ... from tblX t1 where mainTbl.ID = t1.ID)
Rich
*** Sent via Developersdex http://www.developersdex.com ***
.
- Prev by Date: Re: how do I keep the query result when I switch to design view?
- Next by Date: Re: How to stop a running query? esc, crtl+break do not work
- Previous by thread: View variable values
- Next by thread: Changing the format of text
- Index(es):
Relevant Pages
|