<?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 Re: Temp table in stored procedure causes crash in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Temp-table-in-stored-procedure-causes-crash/m-p/384140#M1168137</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi yalco,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;maybe if you change the way you create the temp table. Instead, use a table variable:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DECLARE @TibetanYaks TABLE (&lt;/P&gt;&lt;P&gt;YakID int,&lt;/P&gt;&lt;P&gt;YakName char(30) )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INSERT INTO @TibetanYaks (YakID, YakName)&lt;/P&gt;&lt;P&gt;SELECT&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;YakID, YakName&lt;/P&gt;&lt;P&gt;FROM&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dbo.Yaks&lt;/P&gt;&lt;P&gt;WHERE&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;YakType = 'Tibetan'&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;SELECT *&lt;/P&gt;&lt;P&gt;FROM @TibetanYaks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I took the sample above from &lt;A class="loading" href="http://www.sqlteam.com/article/temporary-tables"&gt;http://www.sqlteam.com/article/temporary-tables&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It says that:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;If you have less than 100 rows generally use a table variable.&amp;nbsp; Otherwise use&amp;nbsp; a temporary table.&amp;nbsp; This is because SQL Server won't create statistics on table variables.&lt;/LI&gt;&lt;LI&gt;If you need to create indexes on it then you must use a temporary table.&lt;/LI&gt;&lt;LI&gt;When using temporary tables always create them and create any indexes and then use them.&amp;nbsp; This will help reduce recompilations.&amp;nbsp; The impact of this is reduced starting in SQL Server 2005 but it's still a good idea.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps&lt;/P&gt;&lt;P&gt;Fernando&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 11 Sep 2012 16:10:37 GMT</pubDate>
    <dc:creator>fosuzuki</dc:creator>
    <dc:date>2012-09-11T16:10:37Z</dc:date>
    <item>
      <title>Temp table in stored procedure causes crash</title>
      <link>https://community.qlik.com/t5/QlikView/Temp-table-in-stored-procedure-causes-crash/m-p/384133#M1168130</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am trying to use a sql server stored procedure in qlikview 10.&lt;/P&gt;&lt;P&gt;My procedure is something like this:&lt;/P&gt;&lt;P&gt;create proc sp_test&lt;/P&gt;&lt;P&gt;as&lt;/P&gt;&lt;P&gt;select a,b,c into #tmp from xxxx&lt;/P&gt;&lt;P&gt;select x,y,z,b from table join #tmp on #tmp.a=table.y&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And I call stored procedure as&lt;/P&gt;&lt;P&gt;SQL Exec sp_test;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Every time trying to reload this script causes crash. There is no error, no message, just crash.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If i remove the temp table part of stored procedure as this:&lt;/P&gt;&lt;P&gt;create proc sp_test&lt;/P&gt;&lt;P&gt;as&lt;/P&gt;&lt;P&gt;select x,y,z from table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then everything works fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there limitation for qlikview that i cannot use temp tables in my procedures? I tried almost everything and i couldn't fine a solution except not using temp tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you help me about this problem?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Sep 2012 21:31:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Temp-table-in-stored-procedure-causes-crash/m-p/384133#M1168130</guid>
      <dc:creator />
      <dc:date>2012-09-04T21:31:21Z</dc:date>
    </item>
    <item>
      <title>Re: Temp table in stored procedure causes crash</title>
      <link>https://community.qlik.com/t5/QlikView/Temp-table-in-stored-procedure-causes-crash/m-p/384134#M1168131</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The credential you are using to connect to the SQL has rights to create a temp table in the database?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Sep 2012 21:49:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Temp-table-in-stored-procedure-causes-crash/m-p/384134#M1168131</guid>
      <dc:creator>fosuzuki</dc:creator>
      <dc:date>2012-09-04T21:49:17Z</dc:date>
    </item>
    <item>
      <title>Re: Temp table in stored procedure causes crash</title>
      <link>https://community.qlik.com/t5/QlikView/Temp-table-in-stored-procedure-causes-crash/m-p/384135#M1168132</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, my user has system admin rights.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Sep 2012 05:02:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Temp-table-in-stored-procedure-causes-crash/m-p/384135#M1168132</guid>
      <dc:creator />
      <dc:date>2012-09-05T05:02:17Z</dc:date>
    </item>
    <item>
      <title>Re: Temp table in stored procedure causes crash</title>
      <link>https://community.qlik.com/t5/QlikView/Temp-table-in-stored-procedure-causes-crash/m-p/384136#M1168133</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You're connecting to the SQL Server via ODBC or OLEDB?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Sep 2012 19:20:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Temp-table-in-stored-procedure-causes-crash/m-p/384136#M1168133</guid>
      <dc:creator>fosuzuki</dc:creator>
      <dc:date>2012-09-05T19:20:01Z</dc:date>
    </item>
    <item>
      <title>Re: Temp table in stored procedure causes crash</title>
      <link>https://community.qlik.com/t5/QlikView/Temp-table-in-stored-procedure-causes-crash/m-p/384137#M1168134</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OLEDB&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Sep 2012 05:34:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Temp-table-in-stored-procedure-causes-crash/m-p/384137#M1168134</guid>
      <dc:creator />
      <dc:date>2012-09-06T05:34:33Z</dc:date>
    </item>
    <item>
      <title>Re: Temp table in stored procedure causes crash</title>
      <link>https://community.qlik.com/t5/QlikView/Temp-table-in-stored-procedure-causes-crash/m-p/384138#M1168135</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you revise your store procedure and make it a SQL?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;load *&lt;/P&gt;&lt;P&gt;sql select &lt;/P&gt;&lt;P&gt; a,b,c, &lt;/P&gt;&lt;P&gt;x,y,z,b from table xxx join&amp;nbsp; table on xxx.a=table.y&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then you can create your own table or qvd?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Sep 2012 18:20:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Temp-table-in-stored-procedure-causes-crash/m-p/384138#M1168135</guid>
      <dc:creator>alexpanjhc</dc:creator>
      <dc:date>2012-09-06T18:20:45Z</dc:date>
    </item>
    <item>
      <title>Re: Temp table in stored procedure causes crash</title>
      <link>https://community.qlik.com/t5/QlikView/Temp-table-in-stored-procedure-causes-crash/m-p/384139#M1168136</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It was just an example. My sp is more complicated than that. It first fill sales into to a temp table and then it uses a lot of subqueries from this table. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Sep 2012 18:34:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Temp-table-in-stored-procedure-causes-crash/m-p/384139#M1168136</guid>
      <dc:creator />
      <dc:date>2012-09-06T18:34:30Z</dc:date>
    </item>
    <item>
      <title>Re: Temp table in stored procedure causes crash</title>
      <link>https://community.qlik.com/t5/QlikView/Temp-table-in-stored-procedure-causes-crash/m-p/384140#M1168137</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi yalco,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;maybe if you change the way you create the temp table. Instead, use a table variable:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DECLARE @TibetanYaks TABLE (&lt;/P&gt;&lt;P&gt;YakID int,&lt;/P&gt;&lt;P&gt;YakName char(30) )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INSERT INTO @TibetanYaks (YakID, YakName)&lt;/P&gt;&lt;P&gt;SELECT&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;YakID, YakName&lt;/P&gt;&lt;P&gt;FROM&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dbo.Yaks&lt;/P&gt;&lt;P&gt;WHERE&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;YakType = 'Tibetan'&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;SELECT *&lt;/P&gt;&lt;P&gt;FROM @TibetanYaks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I took the sample above from &lt;A class="loading" href="http://www.sqlteam.com/article/temporary-tables"&gt;http://www.sqlteam.com/article/temporary-tables&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It says that:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;If you have less than 100 rows generally use a table variable.&amp;nbsp; Otherwise use&amp;nbsp; a temporary table.&amp;nbsp; This is because SQL Server won't create statistics on table variables.&lt;/LI&gt;&lt;LI&gt;If you need to create indexes on it then you must use a temporary table.&lt;/LI&gt;&lt;LI&gt;When using temporary tables always create them and create any indexes and then use them.&amp;nbsp; This will help reduce recompilations.&amp;nbsp; The impact of this is reduced starting in SQL Server 2005 but it's still a good idea.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps&lt;/P&gt;&lt;P&gt;Fernando&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Sep 2012 16:10:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Temp-table-in-stored-procedure-causes-crash/m-p/384140#M1168137</guid>
      <dc:creator>fosuzuki</dc:creator>
      <dc:date>2012-09-11T16:10:37Z</dc:date>
    </item>
  </channel>
</rss>

