suoirotciv
Programmer
I need to loop to lots of excel file so i need to pass the file name. But using SET @FileName = 'C:\MyExcelFile.xls' and pass it on the code below is not working.
FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0','Excel 8.0;Database=C:\MyExcelFile.xls;HDR=YES', 'SELECT * FROM [Sheet1$]')
My Code
========================================
I kept my Job because of TEK-TIPS
Thanks a lot to all who keeps on helping others.
FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0','Excel 8.0;Database=C:\MyExcelFile.xls;HDR=YES', 'SELECT * FROM [Sheet1$]')
My Code
Code:
SET @FileName = 'C:\MyExcelFile.xls'
FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0','Excel 8.0;Database='+ @FileName + ';HDR=YES', 'SELECT * FROM [Sheet1$]')
========================================
I kept my Job because of TEK-TIPS
Thanks a lot to all who keeps on helping others.