MS Access Stored procedure , result into table

dh_ander

Board Regular
Joined
Jul 31, 2006
Messages
119
I wrote a sql pass through query which executes a storede procedure on my SQL server
All the code I need is : execute dbo.msp_Fill_CEDS

Now I want to put the result into a table "hlptblTest" in my access database.

The result of my stored procedure is a table with 3 colums my table "hlptblTest" also has 3 colums.

What would be the syntax to put the result of my stored procedure straight into my table?
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.

SydneyGeek

MrExcel MVP
Joined
Aug 5, 2003
Messages
12,251
Hi David,

Try this:

1. Build a second pas-through query that retrieves the output table from the stored procedure
2. Use a Make-table or Append query to push this into your local table

When you want to update data, run 3 SQL statements in sequence:
The stored procedure
A Delete query to clean out the data in the Access table
The Update query to push in the new data.

Note: this will work only if you do NOT have a primary key field in your Access table. In circumstances where I am pulling data in from a SQL source and may be refreshing everything, I don't bother with a local primary key

Denis
 

Forum statistics

Threads
1,141,755
Messages
5,708,320
Members
421,565
Latest member
Lastadiego

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top