Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Using a variable to store a table

Author  Topic 

Serge
Starting Member

44 Posts

Posted - 2007-08-09 : 06:00:12
Hi,

I have a question. I have a standard query that retrieves the list of users from a database. The query uses "exist" statement and inside it I have another smaller query. The smaller query which used withing exist statement is called numerous times during the query execution. I am wondering if I can speed things up by storing result of a smaller query in a table rather than asking DB to run it again and again. The query takes over a minute to run and I am trying to find a way of speeding it up.

Thanks a lot

Serge

ditch
Master Smack Fu Yak Hacker

1466 Posts

Posted - 2007-08-09 : 06:03:54
This can probably be done in a join.
Post your code and I'm sure that some of the SQL Guru's here will whip up a suggestion/solution in no time.


Duane.
Go to Top of Page

nr
SQLTeam MVY

12543 Posts

Posted - 2007-08-09 : 07:23:45
Removed by request.


==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -