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
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Executing large SP s

Author  Topic 

ravilobo
Master Smack Fu Yak Hacker

1184 Posts

Posted - 2004-05-21 : 04:25:46
I have several SP's need to be exexuted one after other. Each of these SP is taking around 1 hour. Instead of waiting for each of them to complete and start the next one, i was planning to put all of them in a single sp and execute at once. My friends feel that this may block server resources till the whole process completes. Now i am planning to execute all the sp's in QA with a GO in between.

execute sp1
GO
execute sp2
GO
execute sp3
GO
execute sp4
GO


So that each will execute in its own batch. Is this the correct approach? Or is there a better way?


Thank you.


------------------------
I think, therefore I am

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-05-21 : 12:24:39
They will still execute one after the other though regardless of the GOs and regardless if they are in one stored procedure. You would have to launch each of the at the same time in a different QA window. You need to investigate why they are taking so long. What is it doing? Cursors and loops and lots more cursors?

Tara
Go to Top of Page

ravilobo
Master Smack Fu Yak Hacker

1184 Posts

Posted - 2004-05-23 : 07:49:47
What i want to know is whether the resources used to proces sp1 will be released while processing sp3 (for e.g.)?

If NO then may be i can put all the sps content in a single SP....


------------------------
I think, therefore I am
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-05-24 : 11:59:35
What resources though?

Tara
Go to Top of Page

ravilobo
Master Smack Fu Yak Hacker

1184 Posts

Posted - 2004-05-24 : 12:17:40
I will rephrase it...
whether the MEMORY(RAM)used to proces sp1 will be released while processing sp3 (for e.g.)?



------------------------
I think, therefore I am
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-05-24 : 12:19:44
Memory is not automatically released in SQL Server. SQL Server often never releases it as no other process on the server requires it. If you are talking about temporary tables, then those would get released on DROP or after the stored procedure completes.

So SQL Server will retain the memory until it is done with it AND another process on the server needs it.

Tara
Go to Top of Page

ravilobo
Master Smack Fu Yak Hacker

1184 Posts

Posted - 2004-05-25 : 02:14:14
Thank you.

------------------------
I think, therefore I am
Go to Top of Page
   

- Advertisement -