|
Posted by Erland Sommarskog on 05/05/06 01:05
(lonestarprogramming@gmail.com) writes:
> I can make this run in the Query Analyzer:
> SELECT * INTO Audit
> FROM OPENDATASOURCE( 'Microsoft.Jet.OLEDB.4.0',
> 'Data Source = ''C:\Spreadsheets\Audits.xls\Audit_TC.xls'';Extended
> Properties=Excel 8.0')...Audit$
>
> I could run the SQL directly from my app, but I like to use stored
> procs whenever I can for the speed and flexibility. I can change the
> stored proc and not have to recompile/reinstall the app.
To do this in a stored procedure, you would have to use dynamic SQL.
See http://www.sommarskog.se/dynamic_sql.html for details.
--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
Navigation:
[Reply to this message]
|