>Thanks for the suggestions.
>
>But my point is, How could I program it (Exporting data into Excel)
>in a stored procedure with two parameters:
>
> 1. Source data (from a view or table)
> 2. Destination (Excel file (ex. C:\mydata.xls)
You could use the extended stored procedures in SQL Server sp_OA... to create an object reference to DTS and execute it using your parameters. Use the OA SPs to automate the creation of a package and the associated steps and tasks. That would the only way I know of to do it in SQL Server.
And yes the OLE Automation SPs are in SQL Server 7. Take a look at the BOL for more information.
Larry Miller
MCSD
LWMiller3@verizon.netAccumulate learning by study, understand what you learn by questioning. -- Mingjiao