Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copying data from Stored procedure in one database to a table

Status
Not open for further replies.

vwani

Programmer
May 26, 2004
10
US
Hi Folks,

I have a question.I have a stored procedure called sp_stored_proc in a Database called globaldataabase.
This stored procedure pulls out information from several tables in the same database and creates a huge recordset.I want to pull out 2 fields(mlsno,mlsid) from the result of this stored procedure.There is a unique identifier called 'Name' on basis of which I will pull out the two fields.

Now I want to copy data from this two fields in a table in another database.I have created this table with 4 fields of which 2 fields are pulled from the result of stored procedure and remaining 2 fields will be set according to the selections made by user through radio buttons in a form.

My question is how to do the above thing.
Does this look ok?
Dim Queryread
Dim Querywrite

Set Queryread = Server.Createobject("Objectname")
Queryread.parameter("query") = "Procedure_Name"
Queryread.parameter("PRM_Select")="mlsno,mlsid"
Queryread.parameter("PRM_mlsno")= Reuest.querystring("PRM_mlsno")
Queryread.parameter("PRM_mlsid")= Reuest.querystring("PRM_mlsid")
Queryread.parameter("PRM_Select")="mlsno,mlsid"
Queryread.parameter("PRM_Where") = "Name = 'link'"
Queryread.run

Set Querywrite = Server.Createobject("Objectname")
Querywrite.parameter("table") = "Table_Name"
Querywrite.parameter("CEQ_mlsno")= Request.Querystring("mlsno")
Querywrite.parameter("CEQ_mlsid")= Request.Querystring("mlsid")


Do Until Queryread.EOF
----
Further I am confused.Please help.

Thank You
 
why do it this way, if you know how to manage SP's then just make a recordset return SP ( the one you already have )and in that one add the insert statement for this other table, then in your ASP you only have to call it and be done with it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top