• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Using #temptable in OLE DB connection

ablinkx

New Member
Using Excel 2013, SQLServer 2010.
I'd like to use a temp table in an OLE DB Query data connection. The Command text is something like this (very simplified):

select * into #temptable from SQLTableA
select * from #temptable
drop table #temptable

Are #temptables allowed for OLE DB queries?
 
Hi, ablinkx!

Actually never tried to do that, but why not just setting a connection string to any table, check it works properly and then change the source to the related temp table?

Regards!
 
Hi,

Yes they are allowed but make sure you use a SET NOCOUNT ON directive otherwise you'll have problems with trying to retreive data (due to the INSERT) into a recordset from your SELECT * FROM #temptable query.
 
Back
Top