Error using temp tables (e.g. #temp_values) in "Execute Command" SQL

  • 223Views
  • Last Post 4 weeks ago
0
votes
Anthony Moquin posted this 10 October 2022

Hi,

With SQL Server as a source connection for an Import package, is it possible to create and use temp tables in the "Advanced / Execute Command" SQL?  I receive "Invalid object name" errors when I try, even though it is valid T-SQL syntax.

Simple example (please see attached screenshot):

select *
into #temp_values
from (values
      ('a', 1)
    , ('b', 2)) v(x, y)

select *
from #temp_values

Could you please me know if this is supported?

Thank you,

-Anthony

 

Attached Files

Order By: Standard | Newest | Votes
0
votes
Serhii Muzyka posted this 10 October 2022

 Hi Anthony,

 

Thank you for contacting Skyvia Support.

 

To understand your situation, we would like to ask you to check this query by using Skyvia Query tool.

 

Let us know if you get the same error. 

 

Best regards,

Serhii

0
votes
Anthony Moquin posted this 4 weeks ago

Hi Serhii,

Yes, that same query works fine in the Query tool (see image)!

Thanks,

-Anthony

 

0
votes
Serhii Muzyka posted this 4 weeks ago

Hi,

 

Thank you for your response. 

 

After a detailed investigation of your situation, we can state that temp tables aren't supported. However, you can use the simple query 

SELECT *

FROM (values ('a', 1) , ('b', 2)) v(x, y); and get the same result.

Also, those temp tables will be only available in current package while executing it.

According to that, to pursue with your request and investigate the possibility to implement temp tables, let us know in details what are you trying to achieve with them.

 

We are looking forward to your reply.  

 

Best regards,

Serhii

Technical Support Engineer

 

Close