ASP/ Stored Procedure Query

  • Thread starter Andrew J Durstewitz
  • Start date
A

Andrew J Durstewitz

Hi!

I'm not sure if you can do this but what I want to do it execute a
stored procedure but query it with dynamic ASP data. Basically,

exex StoredProc where id = 2

I am using a set of dynamic data and I truly belive looping trought the
dataset would be too much overhead on the server.

Any ideas?

Thanks,
Andrew J Durstewitz

DEVBuilder.org, http://www.DEVBuilder.org
ASP,ASP.NET,VB.NET,PHP,Java,and SQL Support, all in one place.
 
R

Ray at

What does your SP look like? Doesn't it allow you to pass an argument to
it?

create proc YourStoredProc @theID int AS...

Ray at work
 
A

Andrew J Durstewitz

The problem with that is I'm using a dynamic where statement. Basically
I have a loop like so...

Do While Not blah.Eof
sqlStatment = " or id=" & blah("id")
blah.MoveNext
Loop

Otherwise I could use that idea, unless there is something I am missing
about getting dynamic information into SQL.

DEVBuilder.org, http://www.DEVBuilder.org
ASP,ASP.NET,VB.NET,PHP,Java,and SQL Support, all in one place.
 
R

Ray at

I don't understand. You already have your recordset in the code you posted
below. You aren't doing anything with the ID at that point other than
concatenating some strings.

create theStoredProc @theArg int as
select whatever from wherever where id=@theArg


<%
theID = [your source for the ID]
Set rs = yourADOConnection.Execute("exec theStoredProc " & theID)
'...
%>

Ray at work
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top