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.
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.
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
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 * ?????')
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.