baskaran chellasamy

baskaran chellasamy

  • NA
  • 114
  • 146.7k

sql query error

Aug 22 2012 4:12 PM
Hi friends
 this is my store procedure for getting external excel file and save into sql  database.
create procedure sp_excelforgeneralholidays(@filname nvarchar(max))
 as 
 set nocount on
  begin
 select *  from OPENROWSET('Microsoft.jet.OLEDB.4.0','Excel 8.0;DATABASE=' + @filname + ', Select Date,Day,Reason from [sheet1$])'
 end
When i Run this error  is near syntax error + . but i dont know how to solve this problem please help me

Answers (6)