Groups | Blog | Home
all groups > sql server programming > november 2004 >

sql server programming : stored procedure row output to access table


gtr
11/12/2004 7:45:01 PM
Hello.
I have a sql server stored procedure (with input parms) that outputs rows
via a select stmt.

I am using vb 6 and need to place those rows in a local access table.
Obviously I can get a recordset back, loop thru the individual rows and
insert them one by one into the local access table.

Is there a way to firehose/stream those rows straight into my local access
table?

Dandy Weyn
11/13/2004 4:01:26 AM
INSERT INTO TBL_yourtable
EXEC STP_storedprocedure

[quoted text, click to view]

gtr
11/13/2004 2:22:01 PM
Thanks Dandy.
This looks like the way i would do it in T-sql. Does something like this
work in vb? If so, how?

[quoted text, click to view]
gtr
11/13/2004 2:25:01 PM
Hugo,
Yes you are right, maybe this question should have been asked in a vb/access
newsgroup.
I think this just may work - select into from pass-through query.

Thanks for your help.


[quoted text, click to view]
Hugo Kornelis
11/13/2004 10:27:03 PM
[quoted text, click to view]

Hi gtr,

Should this question not be asked in an Access or VB newsgroup?

Anyway, here are the steps to do what you want in Access. I know almost
nothing about VB, but I think you can work out how to initiate theses
steps from VB code.

1. Create a pass-through query (named Query1 in my example) with this SQL
test:
exec sp_who '3'
(I used sp_who as example proc and '3' as example parameter).
2. Create a second query with the following SQL text:
SELECT Query1.* INTO Test
FROM Query1;
3. Execute the second query.

Best, Hugo
--

AddThis Social Bookmark Button