i am importing my data from excel file to Sql Database using openrowset following are my command
declare @path varchar(100)='E:\11.08.2017 .xlsx;'
SELECT * into palwal12 FROM OPENROWSET('Microsoft.ACE.OLEDB.12.0',
'Excel 12.0; Database='+@path+' HDR=YES; IMEX=1',
'SELECT * FROM [sheet1$]')
i successfully insert data into table while using simple query. but when if i want to use variable path to insert data then i m having an error as incorrect syntax near '+'. i thought my syntax for using path variable is wrong. somebody could help me please.