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
 General SQL Server Forums
 New to SQL Server Programming
 How to parameterise the Excel Sheet Name in a SP

Author  Topic 

Orbison
Starting Member

14 Posts

Posted - 2010-03-08 : 06:29:13
Hi Guys,
Anyone know how i parameterise the Sheetname [SHEET1$] in my Stored Procedure instead of having to hardcode it in like:

FROM OPENROWSET ('MICROSOFT.JET.OLEDB.4.0',
'EXCEL 8.0;DATABASE=\\myserver\myData\myproducts.xls;',
'Select Products FROM [SHEET1$]') AS Prod_ID

I'm using SQL Server 2008.

Thanks in advance

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2010-03-08 : 07:34:54
See this page
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=49926&whichpage=24

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -