<?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: Explicit passthrough problems with temp tables to SQL server database in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Explicit-passthrough-problems-with-temp-tables-to-SQL-server/m-p/595257#M15768</link>
    <description>The temp table does not dissappear after the data step. Test keeps existing.&lt;BR /&gt;In the passthrough i don t use a disconnect......</description>
    <pubDate>Thu, 10 Oct 2019 05:19:03 GMT</pubDate>
    <dc:creator>Billybob73</dc:creator>
    <dc:date>2019-10-10T05:19:03Z</dc:date>
    <item>
      <title>Explicit passthrough problems with temp tables to SQL server database</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Explicit-passthrough-problems-with-temp-tables-to-SQL-server/m-p/595063#M15728</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm facing a problem with explicit pass throughs to SQL server database.&lt;/P&gt;&lt;P&gt;The following code works fine :&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="1"&gt;options&lt;/FONT&gt;&lt;FONT face="Courier New" size="1"&gt; sastrace=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="1"&gt;',,,d'&lt;/FONT&gt;&lt;FONT face="Courier New" size="1"&gt; sastraceloc=saslog nostsuffix;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="1"&gt;%let&lt;/FONT&gt;&lt;FONT face="Courier New" size="1"&gt; dsn = &amp;lt;mydatabase&amp;gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="1"&gt;%let&lt;/FONT&gt;&lt;FONT face="Courier New" size="1"&gt; authdomain = &amp;lt;myauthdomain&amp;gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="1"&gt;libname&lt;/FONT&gt;&lt;FONT face="Courier New" size="1"&gt; tempdb &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="1"&gt;odbc&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="1"&gt;dsn&lt;/FONT&gt;&lt;FONT face="Courier New" size="1"&gt;=&amp;amp;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="1"&gt;dsn.&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="1"&gt;authdomain&lt;/FONT&gt;&lt;FONT face="Courier New" size="1"&gt;=&amp;amp;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="1"&gt;authdomain.&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="1"&gt;connection&lt;/FONT&gt;&lt;FONT face="Courier New" size="1"&gt;=shared;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="1"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="1"&gt; test;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="1"&gt;date = &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="1"&gt;'01JAN2019'd&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="1"&gt; ;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="1"&gt;datetime = &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="1"&gt;'01JAN2019:00:00'dt&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="1"&gt; ;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="1"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="1"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="1"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="1"&gt; tempdb.'#test'n;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="1"&gt;set&lt;/FONT&gt;&lt;FONT face="Courier New" size="1"&gt; test;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="1"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="1"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="1"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="1"&gt; test;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="1"&gt;set&lt;/FONT&gt;&lt;FONT face="Courier New" size="1"&gt; tempdb.'#test'n;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="1"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="1"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However when I do the following :&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="1"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="1"&gt;sql&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="1"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="1"&gt;connect&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="1"&gt;to&lt;/FONT&gt;&lt;FONT face="Courier New" size="1"&gt; odbc &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="1"&gt;as&lt;/FONT&gt;&lt;FONT face="Courier New" size="1"&gt; test (dsn=&amp;amp;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="1"&gt;dsn.&lt;/FONT&gt;&lt;FONT face="Courier New" size="1"&gt; authdomain=&amp;amp;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="1"&gt;authdomain.&lt;/FONT&gt;&lt;FONT face="Courier New" size="1"&gt; connection=shared);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="1"&gt;execute&lt;/FONT&gt;&lt;FONT face="Courier New" size="1"&gt; (&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1"&gt;create table #datumtijd&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1"&gt;(&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1"&gt;datum DATE,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1"&gt;datumtijd DATETIME,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1"&gt;)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="1"&gt;) &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="1"&gt;by&lt;/FONT&gt;&lt;FONT face="Courier New" size="1"&gt; test;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="1"&gt;&lt;STRONG&gt;quit&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="1"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="1"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="1"&gt; test;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="1"&gt;set&lt;/FONT&gt;&lt;FONT face="Courier New" size="1"&gt; tempdb.'#datumtijd'n;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="1"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="1"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I get the message :&lt;/P&gt;&lt;P&gt;ERROR: File TEMPDB.'#datumtijd'n.DATA does not exist.&lt;/P&gt;&lt;P&gt;Why is that ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to insert the data from &lt;FONT face="Courier New" size="1"&gt;'#test'n&lt;/FONT&gt; into &lt;FONT face="Courier New" size="1"&gt;'#datumtijd'n. Like this :&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="1"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="1"&gt;sql&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="1"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="1"&gt;connect&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="1"&gt;to&lt;/FONT&gt;&lt;FONT face="Courier New" size="1"&gt; odbc &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="1"&gt;as&lt;/FONT&gt;&lt;FONT face="Courier New" size="1"&gt; test (dsn=&amp;amp;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="1"&gt;dsn.&lt;/FONT&gt;&lt;FONT face="Courier New" size="1"&gt; authdomain=&amp;amp;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="1"&gt;authdomain.&lt;/FONT&gt;&lt;FONT face="Courier New" size="1"&gt; connection=shared);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="1"&gt;execute&lt;/FONT&gt;&lt;FONT face="Courier New" size="1"&gt; (&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1"&gt;INSERT INTO #datumtijd&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1"&gt;SELECT * FROM #test)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="1"&gt;by&lt;/FONT&gt;&lt;FONT face="Courier New" size="1"&gt; test ; &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="1"&gt;disconnect&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="1"&gt;from&lt;/FONT&gt;&lt;FONT face="Courier New" size="1"&gt; odbc;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="1"&gt;&lt;STRONG&gt;quit&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="1"&gt;; &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your help !!&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;BB&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Oct 2019 14:31:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Explicit-passthrough-problems-with-temp-tables-to-SQL-server/m-p/595063#M15728</guid>
      <dc:creator>Billybob73</dc:creator>
      <dc:date>2019-10-09T14:31:35Z</dc:date>
    </item>
    <item>
      <title>Re: Explicit passthrough problems with temp tables to SQL server database</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Explicit-passthrough-problems-with-temp-tables-to-SQL-server/m-p/595097#M15730</link>
      <description>I suspect that when you disconnect your temp tables are lost due to starting a new session/connection. Do you have a schema you can write to that will persist between sessions?</description>
      <pubDate>Wed, 09 Oct 2019 15:08:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Explicit-passthrough-problems-with-temp-tables-to-SQL-server/m-p/595097#M15730</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-10-09T15:08:45Z</dc:date>
    </item>
    <item>
      <title>Re: Explicit passthrough problems with temp tables to SQL server database</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Explicit-passthrough-problems-with-temp-tables-to-SQL-server/m-p/595193#M15754</link>
      <description>&lt;P&gt;Check what is happening in SQL Server Management Studio in the tempdb database.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What happens if you continue to use your LIBNAME database connection like so:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
  connect using tempdb;
&amp;lt;put your passthru query here&amp;gt;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 09 Oct 2019 20:42:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Explicit-passthrough-problems-with-temp-tables-to-SQL-server/m-p/595193#M15754</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2019-10-09T20:42:54Z</dc:date>
    </item>
    <item>
      <title>Re: Explicit passthrough problems with temp tables to SQL server database</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Explicit-passthrough-problems-with-temp-tables-to-SQL-server/m-p/595257#M15768</link>
      <description>The temp table does not dissappear after the data step. Test keeps existing.&lt;BR /&gt;In the passthrough i don t use a disconnect......</description>
      <pubDate>Thu, 10 Oct 2019 05:19:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Explicit-passthrough-problems-with-temp-tables-to-SQL-server/m-p/595257#M15768</guid>
      <dc:creator>Billybob73</dc:creator>
      <dc:date>2019-10-10T05:19:03Z</dc:date>
    </item>
    <item>
      <title>Re: Explicit passthrough problems with temp tables to SQL server database</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Explicit-passthrough-problems-with-temp-tables-to-SQL-server/m-p/597943#M16220</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/172904"&gt;@Billybob73&lt;/a&gt;&amp;nbsp; - I guess your latest thread supersedes this one. Note, I've posted a question regarding your SAS version there.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 19 Oct 2019 22:43:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Explicit-passthrough-problems-with-temp-tables-to-SQL-server/m-p/597943#M16220</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2019-10-19T22:43:44Z</dc:date>
    </item>
  </channel>
</rss>

