March 2, 2012 at 8:33 am
I think you still can do it with ##table, but you need to make everything in to your dynimc sql string:
DECLARE @sql VARCHAR(8000)
DECLARE @IdNbr VARCHAR(50)
SET @IdNbr = '312012145014'
SET @sql = 'INSERT INTO OPENROWSET (''Microsoft.Jet.OLEDB.4.0'',
''Excel 8.0;Database=c:\partner_files\Templates\open_call_reporttemp.xls;'',
''SELECT * FROM [Sheet1$]'')
select * from ##TempOpenCallData_' + @IdNbr
EXEC (@sql)
March 2, 2012 at 8:58 am
Eugene Elutin (3/2/2012)
I think you still can do it with ##table, but you need to make everything in to your dynimc sql string:
DECLARE @sql VARCHAR(8000)
DECLARE @IdNbr VARCHAR(50)
SET @IdNbr = '312012145014'
SET @sql = 'INSERT INTO OPENROWSET (''Microsoft.Jet.OLEDB.4.0'',
''Excel 8.0;Database=c:\partner_files\Templates\open_call_reporttemp.xls;'',
''SELECT * FROM [Sheet1$]'')
select * from ##TempOpenCallData_' + @IdNbr
EXEC (@sql)
Yes!! This works as well, and allows me to stick with the temp tables!
thanks!!
Viewing 2 posts - 16 through 16 (of 16 total)
You must be logged in to reply to this topic. Login to reply