Export Stored Procedure Temp Table to CSV

  • Thread starter Robert Robichaud
  • Start date
R

Robert Robichaud

I've created a global temporary table in SQL (called ##myTempTable) and wish
to export its content to a .CSV file. When I run

DoCmd.TransferText acExportDelim, , "##myTempTable", strFileName, True

I get a run-time error of 7874. I can display the contents of this table in
Query Analyser.

Any ideas?
 
J

Joe Fallon

1. In SQL Server use DTS or other T-SQL code to export the table directly.
Why go through Access?

2. Use SPT query to return the result set.
Then write a Make-Table query based on the SPT query.
Export the newly created local Access table.
 
R

Robert Robichaud

Joe,

Thank you for your suggestion. I need this to run from the Access 2000
(.adp) project. The user pushes a button and the information on the
displayed Order is processed by a SPT. Now I need to export the results
that are stored in a Global temporary table to a .CSV file, for processing
by another application.

I've looked at the Microsoft Knowledge Base Q295646 but can't seem to get
this code to work.

Any other ideas?
 
J

Joe Fallon

Can't a Stored Procedure do all the work for you?
And then drop the file on a network share?
 
R

Robert Robichaud

I've been trying to find out how to do this but I'm hitting a dead end.

I'm digging in the OLB right now on how to do it in a Stored Procdure.

If you can point me in the right direction, it would really help.

Thanks,
 
J

Joe Fallon

I would post over in the SQL Server newsgroup.
I am sure one of those MVPs has done this sort of thing before.
 
R

Robert Robichaud

Will do.

Thank you for your help.

Joe Fallon said:
I would post over in the SQL Server newsgroup.
I am sure one of those MVPs has done this sort of thing before.
--
Joe Fallon
Access MVP



Robert Robichaud said:
I've been trying to find out how to do this but I'm hitting a dead end.

I'm digging in the OLB right now on how to do it in a Stored Procdure.

If you can point me in the right direction, it would really help.

Thanks,


Joe Fallon said:
Can't a Stored Procedure do all the work for you?
And then drop the file on a network share?
--
Joe Fallon
Access MVP



message Joe,

Thank you for your suggestion. I need this to run from the Access 2000
(.adp) project. The user pushes a button and the information on the
displayed Order is processed by a SPT. Now I need to export the results
that are stored in a Global temporary table to a .CSV file, for processing
by another application.

I've looked at the Microsoft Knowledge Base Q295646 but can't seem
to
get
 

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

Top