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 |
|
load1982
Starting Member
3 Posts |
Posted - 2010-02-02 : 09:07:40
|
| Hi hope you can help me...im trying to create a SP, to read an Excel file, but sending the Path thru the Paramters something like this:create procedure getFileInfo(@Path nvarchar(254))asSelect * FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0','Excel 8.0;Database=' + @Path + ;HDR=No', 'SELECT * FROM [Seat Schedule$]') as Excelbut is giving me an error message Msg 170, Level 15, State 1, Procedure getFileInfo, Line 4Line 4: Incorrect syntax near '+'.there any way to do this? |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
DP978
Constraint Violating Yak Guru
269 Posts |
Posted - 2010-02-02 : 09:14:17
|
| And just as an fyi, the reason for this particular error, outside of being the wrong format, was also because you missed a ' after you 2nd + sign. |
 |
|
|
load1982
Starting Member
3 Posts |
Posted - 2010-02-02 : 09:18:57
|
| I really appreciate both comments, and thank you Madhivanan, im trying your solution right now |
 |
|
|
|
|
|
|
|