<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Importing Data from SQL Server 2016 from Stored Procedure w #TmpTbl in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Importing-Data-from-SQL-Server-2016-from-Stored-Procedure-w/m-p/1458992#M36024</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin-bottom: .0001pt;"&gt;I am trying to pull data with the following script in Qlik Sense 3.2:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;LIB CONNECT TO 'ABCSQLServer';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;temp01:&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;NoConcatenate&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;LOAD *;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;SQL EXEC MyDB.dbo.&lt;STRONG&gt;usp_GetDataFromSQL&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;Store temp01 into [lib://SomeQlikLocation\QVDFolder\GetDataFromSQL.QVD] (qvd);&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;drop table temp01;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;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 &lt;STRONG&gt;#tempTable&lt;/STRONG&gt; in the stored procedure everything fails. It appears as if the connection doesn’t have access to &lt;EM&gt;tempdb&lt;/EM&gt; but it does. Does anyone know why this is happening? Your help is greatly appreciated. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 04 Jan 2018 16:00:24 GMT</pubDate>
    <dc:creator>wdchristensen</dc:creator>
    <dc:date>2018-01-04T16:00:24Z</dc:date>
    <item>
      <title>Importing Data from SQL Server 2016 from Stored Procedure w #TmpTbl</title>
      <link>https://community.qlik.com/t5/App-Development/Importing-Data-from-SQL-Server-2016-from-Stored-Procedure-w/m-p/1458992#M36024</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin-bottom: .0001pt;"&gt;I am trying to pull data with the following script in Qlik Sense 3.2:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;LIB CONNECT TO 'ABCSQLServer';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;temp01:&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;NoConcatenate&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;LOAD *;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;SQL EXEC MyDB.dbo.&lt;STRONG&gt;usp_GetDataFromSQL&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;Store temp01 into [lib://SomeQlikLocation\QVDFolder\GetDataFromSQL.QVD] (qvd);&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;drop table temp01;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;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 &lt;STRONG&gt;#tempTable&lt;/STRONG&gt; in the stored procedure everything fails. It appears as if the connection doesn’t have access to &lt;EM&gt;tempdb&lt;/EM&gt; but it does. Does anyone know why this is happening? Your help is greatly appreciated. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Jan 2018 16:00:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Importing-Data-from-SQL-Server-2016-from-Stored-Procedure-w/m-p/1458992#M36024</guid>
      <dc:creator>wdchristensen</dc:creator>
      <dc:date>2018-01-04T16:00:24Z</dc:date>
    </item>
    <item>
      <title>Re: Importing Data from SQL Server 2016 from Stored Procedure w #TmpTbl</title>
      <link>https://community.qlik.com/t5/App-Development/Importing-Data-from-SQL-Server-2016-from-Stored-Procedure-w/m-p/1458993#M36025</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;I've solved this before by putting NOCOUNT ON after the BEGIN of my SP;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;BEGIN&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;SET NOCOUNT ON;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;could you try that?&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;May also be worth turning ansi warnings off.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Jan 2018 16:26:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Importing-Data-from-SQL-Server-2016-from-Stored-Procedure-w/m-p/1458993#M36025</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-01-04T16:26:28Z</dc:date>
    </item>
    <item>
      <title>Re: Importing Data from SQL Server 2016 from Stored Procedure w #TmpTbl</title>
      <link>https://community.qlik.com/t5/App-Development/Importing-Data-from-SQL-Server-2016-from-Stored-Procedure-w/m-p/1458994#M36026</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;/* This code worked after implementing recommendations of Gareth Wilson */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;USE [Master]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;GO&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;SET ANSI_NULLS ON&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;GO&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;SET QUOTED_IDENTIFIER ON&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;GO&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;-- =============================================&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;-- Author: Will &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;-- exec [dbo].[Test_TmpTblforQlik]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;-- =============================================&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;CREATE PROCEDURE [dbo].[&lt;STRONG style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;usp_GetDataFromSQL&lt;/STRONG&gt;]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;AS&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;BEGIN&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;SET NOCOUNT ON;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;DROP TABLE IF EXISTS #MyTest_01&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;SELECT * &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;INTO #MyTest_01&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;From&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;(&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Select 'A' as MyLetter, 1 as MyNumber&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Union All &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Select 'B' as MyLetter, 2 as MyNumber&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Union All &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Select 'C' as MyLetter, 3 as MyNumber&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Union All &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Select 'D' as MyLetter, 4 as MyNumber&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;) as Qry_01&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;SELECT * &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;FROM #MyTest_01&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;END&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;GO&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Jan 2018 18:29:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Importing-Data-from-SQL-Server-2016-from-Stored-Procedure-w/m-p/1458994#M36026</guid>
      <dc:creator>wdchristensen</dc:creator>
      <dc:date>2018-01-04T18:29:33Z</dc:date>
    </item>
    <item>
      <title>Re: Importing Data from SQL Server 2016 from Stored Procedure w #TmpTbl</title>
      <link>https://community.qlik.com/t5/App-Development/Importing-Data-from-SQL-Server-2016-from-Stored-Procedure-w/m-p/1458995#M36027</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Previously I had been rewriting my stored procedures with CTEs but this time was different since I used several windowing functions (row_count) and the performance boost of temp table was really needed. Thanks for your quick response and the spot on solution! I really appreciate the help. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Out of curiosity, do you know why the nocount must be turned on? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Jan 2018 18:35:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Importing-Data-from-SQL-Server-2016-from-Stored-Procedure-w/m-p/1458995#M36027</guid>
      <dc:creator>wdchristensen</dc:creator>
      <dc:date>2018-01-04T18:35:09Z</dc:date>
    </item>
    <item>
      <title>Re: Importing Data from SQL Server 2016 from Stored Procedure w #TmpTbl</title>
      <link>https://community.qlik.com/t5/App-Development/Importing-Data-from-SQL-Server-2016-from-Stored-Procedure-w/m-p/1458996#M36028</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No Problem William,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not 100% sure about why this works, I can only speculate that Qlik cannot receive the Done_In_Proc messages when the SP executes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Gareth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Jan 2018 10:24:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Importing-Data-from-SQL-Server-2016-from-Stored-Procedure-w/m-p/1458996#M36028</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-01-05T10:24:24Z</dc:date>
    </item>
  </channel>
</rss>

