Ask a Question related to ASP Database, Design and Development.
-
Jason Burton #1
Is Stored Procedure Running??
How in ASP can I check to see if a stored proc is running??
The reason being is that when I execute this specific stored proc, it takes
a while.. and I dont want the
user to execute it again....
Let me know please.
Jason Burton
[email]talon@starloop.com[/email]
Jason Burton Guest
-
MS SQL stored procedure
I am new to MS SQL server and stored procedures. I currently have a query that looks like: select from table where fieldname IN... -
stored procedure help
Hi all! I am in need of writing a few stored procedures. The first one is to create a stored procedure to recover a database from backup and the... -
help with a stored procedure
I am new to postgres stored procedures and would like a little help. My function basically takes 2 arguments and inserts data into a table from a... -
Stored procedure from stored procedure
Is it possible to create a stored procedure from a stored procedure? When I attempt this inanity, it doesn't blow up until syntax error at the... -
Running an SQL stored procedure with ADO
Hi, I am having a problem running an sql stored procedure with ADO/ASP. If I hard code a select statement, the code works, but when I try to use a... -
Adrian Forbes [ASP MVP] #2
Re: Is Stored Procedure Running??
> How in ASP can I check to see if a stored proc is running??
Not really possible. Let's say the SP is running for another user?
takes> The reason being is that when I execute this specific stored proc, itIs the SP being run synchrously or asynchronously? You would have to> a while.. and I dont want the
> user to execute it again....
control this using Session vars. Set in the session that the SP is being
run, then clear the session value when the SP has finished
Session("RunningSP") = true
objconn.execute "...."
Session("RunningSP") = false
Adrian Forbes [ASP MVP] Guest
-
Jason Burton #3
Re: Is Stored Procedure Running??
Thanks Adrian,
Thats a good ASP method, but I'm wondering if ie. SQL 2000 or in the stored
procedure itself theirs a way to ie. return a value if its presently being
used.. or refreshing..
The stored proc I made just moves data, but scans over 100,000 records
first. Then every time it finds the records it wants to move, it does it
again til all of them are done. Then the proc is done. But I run it like
every other day.
Any ideas? Anyone else have this experience? What do banking institutions
do for large amounts of data to expedite the process? This is dealing with
my SMTP server, (I do ODBC logging) so as a spam solution I check for 550
errors. (thats pretty much what it does..)
Jason
"Adrian Forbes [ASP MVP]" <sorry@noemail.zzz> wrote in message
news:uWRhXpARDHA.2276@TK2MSFTNGP12.phx.gbl...>> > How in ASP can I check to see if a stored proc is running??
> Not really possible. Let's say the SP is running for another user?
>> takes> > The reason being is that when I execute this specific stored proc, it>> > a while.. and I dont want the
> > user to execute it again....
> Is the SP being run synchrously or asynchronously? You would have to
> control this using Session vars. Set in the session that the SP is being
> run, then clear the session value when the SP has finished
>
> Session("RunningSP") = true
> objconn.execute "...."
> Session("RunningSP") = false
>
>
Jason Burton Guest
-
Chris Hohmann #4
Re: Is Stored Procedure Running??
"Jason Burton" <j.burton@intelligence-agency.net> wrote in message
news:vgh7hch4t24d6@corp.supernews.com...stored> Thanks Adrian,
>
> Thats a good ASP method, but I'm wondering if ie. SQL 2000 or in thebeing> procedure itself theirs a way to ie. return a value if its presentlyit> used.. or refreshing..
>
> The stored proc I made just moves data, but scans over 100,000 records
> first. Then every time it finds the records it wants to move, it doeslike> again til all of them are done. Then the proc is done. But I run itinstitutions> every other day.
>
> Any ideas? Anyone else have this experience? What do bankingwith> do for large amounts of data to expedite the process? This is dealing550> my SMTP server, (I do ODBC logging) so as a spam solution I check forit> errors. (thats pretty much what it does..)
>
> Jason
>
>
> "Adrian Forbes [ASP MVP]" <sorry@noemail.zzz> wrote in message
> news:uWRhXpARDHA.2276@TK2MSFTNGP12.phx.gbl...> >> > > How in ASP can I check to see if a stored proc is running??
> > Not really possible. Let's say the SP is running for another user?
> >> > > The reason being is that when I execute this specific stored proc,to> > takes> >> > > a while.. and I dont want the
> > > user to execute it again....
> > Is the SP being run synchrously or asynchronously? You would havebeing> > control this using Session vars. Set in the session that the SP isCheckout sp_who in BOL(Books OnLine). Basically it returns a result set>> > run, then clear the session value when the SP has finished
> >
> > Session("RunningSP") = true
> > objconn.execute "...."
> > Session("RunningSP") = false
> >
> >
>
of running processes. The stored procedure accepts (process id | user id
| active) as filtering parameters. Ideally, if you have the process id
of the procedure in question that's the best way to limit the result
set.
HTH
-Chris
Chris Hohmann Guest
-
Jason Burton #5
Re: Is Stored Procedure Running??
Thanks,
So in reality, I could for example filter using the user id I use for
processing the procedure.. (only one user uses it..)
Then just check that result set if not empty..
Am I correct with this analogy?
Jason
"Chris Hohmann" <hohmannATyahooDOTcom> wrote in message
news:OCcFq5ARDHA.2636@TK2MSFTNGP10.phx.gbl...> "Jason Burton" <j.burton@intelligence-agency.net> wrote in message
> news:vgh7hch4t24d6@corp.supernews.com...> stored> > Thanks Adrian,
> >
> > Thats a good ASP method, but I'm wondering if ie. SQL 2000 or in the> being> > procedure itself theirs a way to ie. return a value if its presently> it> > used.. or refreshing..
> >
> > The stored proc I made just moves data, but scans over 100,000 records
> > first. Then every time it finds the records it wants to move, it does> like> > again til all of them are done. Then the proc is done. But I run it> institutions> > every other day.
> >
> > Any ideas? Anyone else have this experience? What do banking> with> > do for large amounts of data to expedite the process? This is dealing> 550> > my SMTP server, (I do ODBC logging) so as a spam solution I check for> it> > errors. (thats pretty much what it does..)
> >
> > Jason
> >
> >
> > "Adrian Forbes [ASP MVP]" <sorry@noemail.zzz> wrote in message
> > news:uWRhXpARDHA.2276@TK2MSFTNGP12.phx.gbl...> > > > How in ASP can I check to see if a stored proc is running??
> > >
> > > Not really possible. Let's say the SP is running for another user?
> > >
> > > > The reason being is that when I execute this specific stored proc,> to> > > takes
> > > > a while.. and I dont want the
> > > > user to execute it again....
> > >
> > > Is the SP being run synchrously or asynchronously? You would have> being> > > control this using Session vars. Set in the session that the SP is> Checkout sp_who in BOL(Books OnLine). Basically it returns a result set> >> > > run, then clear the session value when the SP has finished
> > >
> > > Session("RunningSP") = true
> > > objconn.execute "...."
> > > Session("RunningSP") = false
> > >
> > >
> >
> of running processes. The stored procedure accepts (process id | user id
> | active) as filtering parameters. Ideally, if you have the process id
> of the procedure in question that's the best way to limit the result
> set.
>
> HTH
> -Chris
>
>
Jason Burton Guest
-
Chris Hohmann #6
Re: Is Stored Procedure Running??
"Jason Burton" <j.burton@intelligence-agency.net> wrote in message
news:vghcb1ablr6n03@corp.supernews.com...<<End of message omitted for brevity>>> Thanks,
>
> So in reality, I could for example filter using the user id I use for
> processing the procedure.. (only one user uses it..)
>
> Then just check that result set if not empty..
>
> Am I correct with this analogy?
>
> Jason
Yes, although you should probably filter on the "cmd" column to make
sure you are capturing the process running your specified procedure. I
don't know how your application is setup, but your sp user could be
spawning other processes. Something else to consider is that a stored
procedure that takes that long should probably not be instantiated via
ASP>ADO>OLEDB>TCP/IP>Agent>SQLServer. I'm sure I left out a few layers
but you get the idea. When you buy a car, you don't wait around at the
factory while it's being built (at least I hope not). You just pick it
up when it's finished. Same thing here, don't make your ASP page wait
around for the sp to finish executing. How about having the sp write to
a log table upon completion or better yet a log file since the data is
relatively static, or better still an XML based log file. That way you
can have ASP parse as you see fit.
HTH
-Chris
Chris Hohmann Guest
-
Chris Hohmann #7
Re: Is Stored Procedure Running??
"Jason Burton" <j.burton@intelligence-agency.net> wrote in message
news:vgi6pa9uicph85@corp.supernews.com...
[url]http://www.aspfaq.com/show.asp?id=2403[/url]> Do you know a site or anything w/SP's or SQL sample applications?
Chris Hohmann Guest



Reply With Quote

