4 Replies Latest reply: Jan 5, 2018 5:24 AM by gareth wilson RSS

    Importing Data from SQL Server 2016 from Stored Procedure w #TmpTbl

    William Christensen

      I am trying to pull data with the following script in Qlik Sense 3.2:

       

      LIB CONNECT TO 'ABCSQLServer';

       

      temp01:

      NoConcatenate

      LOAD *;

      SQL EXEC MyDB.dbo.usp_GetDataFromSQL;

       

      Store temp01 into [lib://SomeQlikLocation\QVDFolder\GetDataFromSQL.QVD] (qvd);

      drop table temp01;

       

      This code works fine as long as the stored procedure pulls data without using a temp table (CTE, Table Variable). However, as soon as I include a #tempTable in the stored procedure everything fails. It appears as if the connection doesn’t have access to tempdb but it does. Does anyone know why this is happening? Your help is greatly appreciated.