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.
| Author |
Topic |
|
tanu
Yak Posting Veteran
57 Posts |
Posted - 2008-04-21 : 15:14:54
|
| I could not figure out what is wrong here.Declare @datasource varchar(70),@filenameImport varchar(150)SELECT * INTO Test FROM OPENDATASOURCE('Microsoft.Jet.OLEDB.4.0', 'Data Source ='+ @filenameImport + ';Extended Properties=Excel 8.0')...[Sheet1$]Msg 102, Level 15, State 1, Line 4Incorrect syntax near '+'. |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2008-04-21 : 15:16:41
|
| You'll need to use dynamic SQL for that.Tara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/ |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
|
|
|