Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Execute an SQL Server 2008 Stored Procedure via PHP/Zend DB with no response

Posted on 2010-11-23
3
Medium Priority
?
1,028 Views
Last Modified: 2012-05-10
Hi there everyone,

I'm looking to execute a 6-7 minute long SQL Server sproc via Zend_DB PHP, but don't want the page to hang while the procedure executes, I just want to set it running in the database then forget about it. Is there a way to do this?
0
Comment
Question by:wellso
3 Comments
 
LVL 143

Assisted Solution

by:Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3] earned 400 total points
ID: 34195580
you could create a sql job ad-hoc, to run once (delete_level = 1):
http://msdn.microsoft.com/en-us/library/ms182079.aspx

and add 1 job step (which is your sql you want to run):
http://msdn.microsoft.com/en-us/library/ms187358.aspx

finally start the job:
http://msdn.microsoft.com/en-us/library/ms186757.aspx

note: all those procedure above are in the msdb database, so you need to refer to that db....

you can, of course, create a procedure in your database, that automates all of the above, and just call that procedure from your web code (recommended)
0
 
LVL 2

Author Comment

by:wellso
ID: 34195597
Im stuck with 2008 express at the moment so don't have access to the Agent Service unfortunatly, I was thinking maybe executing it via a command line call in PHP, although as the database is on a different server I am not 100% sure how to do this.
0
 
LVL 6

Accepted Solution

by:
subhashpunia earned 1600 total points
ID: 34195604
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
Australian government abolished Visa 457 earlier this April and this article describes how this decision might affect Australian IT scene and IT experts.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.
Suggested Courses

824 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question