0

i am using global temp in my sql stored procedure when i upload into azure it is not working, can anyone please help me to solve this issue

please check the below code had problem

 DECLARE @Q1 VARCHAR(MAX)  
   SET @Q1='SELECT *  INTO ##FINAL  FROM 
    (SELECT [ASSIGNEDTO],LEFT([MONTH],3) AS [MONTH],[COUNT]  
    FROM #ASSIGNEE_TICKETSTATUS)A  
    PIVOT(SUM([COUNT])  
    FOR [MONTH] IN('+@COLUMNHEADER +'))B'  
   PRINT @Q1  
   EXECUTE(@Q1)                        

   SELECT * FROM ##FINAL   

i can't write it as direct query it is not working when i wrote in directly, please anyone help

Shui shengbao
  • 18,746
  • 3
  • 27
  • 45
Anson Davis
  • 37
  • 10
  • 1
    I would go with Actual tables instead of global Temp tables in azure.create once and truncate them prior to using them – TheGameiswar Mar 30 '17 at 09:15
  • 1
    As far as i can tell, global temp table is not supported in Azure SQL database. You would receive error 40516 **''Global temp objects are not supported in this version of SQL Server.'** when trying to create global temp table. – Hello Mar 30 '17 at 10:05

0 Answers0