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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Exporting within a Stored Procedure 1

Status
Not open for further replies.

allyne

MIS
Feb 9, 2001
410
US
Is there a way to export the result of a view within a stored procedure. What I want to do is Export qryReport to T:\ in an excel format. The end user will have a button on a form and when clicked do the export.

Thanks for all your help!

Cathy
 
I don't know about directly exporting data to excel format, but you can export data in a text file using BCP utility. That text file then can be converted to excel format.

Andel
andelbarroga@hotmail.com
 
You can create an export job in DTS that will create an Excel file based on a table or SQL statement (you can use your view), then invoke it on demand with DTSRUN. Robert Bradley
teaser.jpg

 
Hi,

I have created a linked server for an Excel worksheet as
EXEC sp_addlinkedserver 'ExcelSource',
'Jet 4.0',
'Microsoft.Jet.OLEDB.4.0',
'c:\aflavin\ExcelFies\SampleDatabase.xls',
NULL,
'Excel 5.0'
GO

I now need to write a Stored Procedure that pulls all the data in the excel file. I am trying to use OPENQUERY but don't know how to write the query. What do I use in the FROM part of the query?

SELECT *
FROM OPENQUERY(ExcelSource, 'SELECT * ?????')

Thanks in advance,
Ann
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top