Access queries upon paramerized acces queries to SQL server? (1 Viewer)

Pauldohert

Something in here
Local time
Today, 09:21
Joined
Apr 6, 2004
Messages
2,101
This may be obviuos - but its not coming to me.

In access - I have a query (Query2) which queries query1.


Query1 has criteria based straight upon Fields in an acces form - or values from a Global Function.


How would I run a similar thing in SQL.

If it was just running query1 in SQL ( as stored procedure sp1) - I could pass the arguments.
However I want to run query2 (sp2)- which in itself has no agruments.
,but arguments are needed for query1 (sp1) that query2 (sp2) is based upon.

How do I pass the argumnents for query1 (sp1) so that I can run query2 (sp2)

Thanks
I hope that makes sense!
 

Meltdown

Registered User.
Local time
Today, 17:21
Joined
Feb 25, 2002
Messages
472
You need to insert the results from query 1 into a temp table in your sproc, then you run a SELECT against the temp table to get the query 2 result you want. At the end of the sproc you drop the temp table.
 

Pauldohert

Something in here
Local time
Today, 09:21
Joined
Apr 6, 2004
Messages
2,101
Ta - that seems like an awful lot of work compared to access queries?
 

pdx_man

Just trying to help
Local time
Today, 09:21
Joined
Jan 23, 2001
Messages
1,347
Just pass your parameters to the second SP and have that pass the same items to the first SP. Pretty simple, really.
 

Pauldohert

Something in here
Local time
Today, 09:21
Joined
Apr 6, 2004
Messages
2,101
HI pdx Man - Thanks

Is there an example of this anywhere out there?


I have the body of sp2 as EXECUTE procReturnID @ID

so the @ID I pass to sp2 is within sp2 passed to sp1.

This seems to return the records I want. -

How would I then join in other sp and views and tables etc.
 
Last edited:

Users who are viewing this thread

Top Bottom