Msg 102, Level 15, State 1, Procedure getdata, Line 12 Incorrect syntax near '@DataFeed'.
ALTER procedure [dbo].[getdata] ( @DataFeed varchar(20)='my.xls' ) as SELECT * FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0','Excel 8.0;Database=E:\backup\'@DataFeed'', 'select * from [Sheet1$] where area is not null')
FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0','Excel 8.0;Database=E:\backup\' + @DataFeed + '', 'select * from [Sheet1$] where area is not null')
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)