Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 creating a stored procedure to create a temp table

Author  Topic 

sharona
Yak Posting Veteran

75 Posts

Posted - 2011-02-22 : 09:34:13
I have an xls workbook with multiple worksheets. i would like to create a stored procedure that would retrieve the data in the xls file and insert into a temp table to use for a report.

is this possible? how would i go about calling the data?

pk_bohra
Master Smack Fu Yak Hacker

1182 Posts

Posted - 2011-02-22 : 10:48:20
One way:

SELECT *
INTO db1.dbo.table1
FROM OPENROWSET('MSDASQL',
'Driver={Microsoft Excel Driver (*.xls)};DBQ=c:\book1.xls',
'SELECT * FROM [sheet1$]')

Another way using openquery:
http://support.microsoft.com/kb/321686
Go to Top of Page

sharona
Yak Posting Veteran

75 Posts

Posted - 2011-02-22 : 11:17:45
i receive this error using sql server 2005

The OLE DB provider "MSDASQL" has not been registered.

does that mean linkserver needs to be installed or something else?
Go to Top of Page
   

- Advertisement -