i need to upload the excel content into temp table. now i am having problem in creating temp table.
in this code, the #tmpxls is able to create.
SELECT * into #tmpxls
FROM OPENROWSET('Microsoft.ACE.OLEDB.12.0',
'Excel 12.0;Database=C:\ALL.XLS;HDR=Yes',
'SELECT * FROM [Report 1$]')
However, in this code, the #tmpxls is NOT able to create.
SET @psExecSql =
'SELECT * INTO #tmpxls
FROM OPENROWSET(''Microsoft.ACE.OLEDB.12.0'',
''Excel 12.0;Database=' + @psFilePath + ';HDR=' + @in_psHeader + ''',
''SELECT * FROM [' + @in_psWSheetName + '$]'')'
EXEC sp_executesql @psExecSql
Can someone pls help in this? thanks in advance!