<?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: temporary tables SQL Server not visible in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/temporary-tables-SQL-Server-not-visible/m-p/598004#M18243</link>
    <description>&lt;P&gt;If using DBMSTEMP=YES as libname option then ALL tables created under this libref are temporary. Or use a libref without DBMSTEMP and the ## notation. That should work as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For joining with a temporary table from the docu &lt;A href="https://go.documentation.sas.com/?docsetId=acreldb&amp;amp;docsetTarget=p0he4t6yjfmkhpn16qrf0cdhllu6.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_self"&gt;here&lt;/A&gt;:&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;To join a temporary table and a permanent table, you need a &lt;STRONG&gt;libref for each table&lt;/STRONG&gt; and these librefs must successfully share a global connection.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 20 Oct 2019 22:17:05 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2019-10-20T22:17:05Z</dc:date>
    <item>
      <title>temporary tables SQL Server not visible</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/temporary-tables-SQL-Server-not-visible/m-p/597687#M18232</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I have&amp;nbsp;4 questions. regarding this :&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Question 1 :&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I'm creating temporary tables in an SQL server database.&lt;/P&gt;&lt;P&gt;This is the way I do it :&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; sqldb &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;DATASRC&lt;/FONT&gt;&lt;FONT face="Courier New" size="1"&gt;=&amp;lt;DB&amp;gt; &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="1"&gt;SCHEMA&lt;/FONT&gt;&lt;FONT face="Courier New" size="1"&gt;=dbo &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;lt;AUTHDOMAIN&amp;gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="1"&gt;PRESERVE_TAB_NAMES&lt;/FONT&gt;&lt;FONT face="Courier New" size="1"&gt;=YES &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;FONT color="#0000ff" face="Courier New" size="1"&gt;INSERTBUFF&lt;/FONT&gt;&lt;FONT face="Courier New" size="1"&gt;=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="1"&gt;1000&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="1"&gt;READBUFF&lt;/FONT&gt;&lt;FONT face="Courier New" size="1"&gt;=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="1"&gt;2500&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;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;CREATE&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="1"&gt;TABLE&lt;/FONT&gt;&lt;FONT face="Courier New" size="1"&gt; sqldb.'##TEST'n(INSERTBUFF=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="1"&gt;1000&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="1"&gt;) &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="1"&gt;AS&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="1"&gt;select&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="1"&gt;distinct&lt;/FONT&gt;&lt;FONT face="Courier New" size="1"&gt; &amp;lt;VARIABLE&amp;gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="1"&gt;from&lt;/FONT&gt;&lt;FONT face="Courier New" size="1"&gt; SQLSERVERLIB.SQLSVRTABLE;&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;This works ! However when I check SQL Server Management Studio, I do not see #TEST in the tempdb&lt;/P&gt;&lt;P&gt;( I check for Databases\System Databases\tempdb\Temporary Tables folder&amp;nbsp;)&lt;/P&gt;&lt;P&gt;What do I need to do differently to make this temp table appear in this folder ?&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Question 2&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I am getting the following error message :&lt;/P&gt;&lt;P&gt;ERROR: CLI execute error: [Microsoft][SQL Server Native Client 11.0][SQL Server]Incorrect syntax near the keyword 'select'.&lt;/P&gt;&lt;P&gt;when I do this :&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;lt;DB&amp;gt; authdomain=&amp;lt;AD&amp;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;create table ##T1 as&lt;/P&gt;&lt;P&gt;select * from ##TEST&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;Why can't I do this ?&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Question 3&lt;/STRONG&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; sqldb &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;DATASRC&lt;/FONT&gt;&lt;FONT face="Courier New" size="1"&gt;=&amp;lt;DB&amp;gt; &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="1"&gt;SCHEMA&lt;/FONT&gt;&lt;FONT face="Courier New" size="1"&gt;=dbo &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;lt;AUTHDOMAIN&amp;gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="1"&gt;PRESERVE_TAB_NAMES&lt;/FONT&gt;&lt;FONT face="Courier New" size="1"&gt;=YES &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;FONT color="#0000ff" face="Courier New" size="1"&gt;INSERTBUFF&lt;/FONT&gt;&lt;FONT face="Courier New" size="1"&gt;=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="1"&gt;1000&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="1"&gt;READBUFF&lt;/FONT&gt;&lt;FONT face="Courier New" size="1"&gt;=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="1"&gt;2500&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;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 face="Courier New" size="1"&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; odbc &lt;FONT color="#0000ff" face="Courier New" size="1"&gt;as&lt;/FONT&gt; test (dsn=&amp;lt;DB&amp;gt; authdomain=&amp;lt;AD&amp;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;create table ##T11&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="1"&gt;(bank_code VARCHAR(&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="1"&gt;30&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="1"&gt;)&lt;/FONT&gt;&lt;/P&gt;&lt;P&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; A;&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; T11;&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; sqldb.'##T11'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;This EXECUTE statement does work ! However why can't I get it from library SQLDB just like the sql in question 1 ?&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Question 4&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;So far I've been using this lib statement to connect to the tempdb on MS SQL server :&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; sqldb &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;DATASRC&lt;/FONT&gt;&lt;FONT face="Courier New" size="1"&gt;=&amp;lt;DB&amp;gt; &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="1"&gt;SCHEMA&lt;/FONT&gt;&lt;FONT face="Courier New" size="1"&gt;=dbo &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;lt;AUTHDOMAIN&amp;gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="1"&gt;PRESERVE_TAB_NAMES&lt;/FONT&gt;&lt;FONT face="Courier New" size="1"&gt;=YES &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;FONT color="#0000ff" face="Courier New" size="1"&gt;INSERTBUFF&lt;/FONT&gt;&lt;FONT face="Courier New" size="1"&gt;=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="1"&gt;1000&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="1"&gt;READBUFF&lt;/FONT&gt;&lt;FONT face="Courier New" size="1"&gt;=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="1"&gt;2500&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="1"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;As you can see I'm referring to a specific database whereas the temp tables should be available across ALL databases.&lt;/P&gt;&lt;P&gt;Is there a different statement which does this ?&lt;/P&gt;&lt;P&gt;In Teradata I always used :&lt;/P&gt;&lt;P&gt;libname volalib teradata authdomain=&amp;lt;authdomain&amp;gt; mode=teradata server=&amp;lt;"server"&amp;gt; connection=global dbmstemp=yes;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a similar MS SQL Statement ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for you help !!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&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>Fri, 18 Oct 2019 11:29:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/temporary-tables-SQL-Server-not-visible/m-p/597687#M18232</guid>
      <dc:creator>Billybob73</dc:creator>
      <dc:date>2019-10-18T11:29:41Z</dc:date>
    </item>
    <item>
      <title>Re: temporary tables SQL Server not visible</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/temporary-tables-SQL-Server-not-visible/m-p/597880#M18233</link>
      <description>&lt;P&gt;Just based on what's documented:&lt;/P&gt;
&lt;P&gt;- Your connection needs to be GLOBAL - &lt;A href="https://go.documentation.sas.com/?docsetId=acreldb&amp;amp;docsetTarget=n0irpkyp22l7vzn1il9lx6f4wmx9.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_self"&gt;link&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;- The docu for INSERTBUFF also states:&amp;nbsp;&lt;EM&gt;&lt;SPAN class="xis-userSuppliedValue"&gt;Microsoft SQL Server, Greenplum Details:&amp;nbsp;&lt;/SPAN&gt;&lt;/EM&gt;&lt;SPAN&gt;&lt;EM&gt;You must specify INSERT_SQL=YES in order to use this option&lt;/EM&gt;. - &lt;A href="https://go.documentation.sas.com/?docsetId=engfedsrv&amp;amp;docsetTarget=p073x9ge12ztnun1uxxzghqp6bty.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_self"&gt;link&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;For below: Because you don't use a GLOBAL connection ##TEST does eventually no more exist.&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;create table ##T1 as
select * from ##TEST&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;Your Teradata example uses:&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;- connection=&lt;STRONG&gt;global&lt;/STRONG&gt;&amp;nbsp;&lt;/EM&gt; but all your SQL Server examples use&amp;nbsp;&lt;EM&gt;connection=&lt;STRONG&gt;shared&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 20 Oct 2019 22:06:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/temporary-tables-SQL-Server-not-visible/m-p/597880#M18233</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2019-10-20T22:06:28Z</dc:date>
    </item>
    <item>
      <title>Re: temporary tables SQL Server not visible</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/temporary-tables-SQL-Server-not-visible/m-p/597897#M18236</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;According to this link it should NOT be global, but shared :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/acreldb/63647/HTML/default/viewer.htm#a002677192.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/acreldb/63647/HTML/default/viewer.htm#a002677192.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;William&lt;/P&gt;</description>
      <pubDate>Sat, 19 Oct 2019 15:55:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/temporary-tables-SQL-Server-not-visible/m-p/597897#M18236</guid>
      <dc:creator>Billybob73</dc:creator>
      <dc:date>2019-10-19T15:55:30Z</dc:date>
    </item>
    <item>
      <title>Re: temporary tables SQL Server not visible</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/temporary-tables-SQL-Server-not-visible/m-p/597932#M18237</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; - Your link is to&amp;nbsp;documentation for SAS 9.2&amp;nbsp; which is an incredibly old release. Is this really the SAS version you are using?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The current version is SAS 9.4 and &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/12447"&gt;@Patrick&lt;/a&gt; provided you the correct links to that. In SAS 9.4 CONNECTION = GLOBAL and DBMSTEMP = YES are the right options to use.&lt;/P&gt;</description>
      <pubDate>Sat, 19 Oct 2019 21:56:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/temporary-tables-SQL-Server-not-visible/m-p/597932#M18237</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2019-10-19T21:56:41Z</dc:date>
    </item>
    <item>
      <title>Re: temporary tables SQL Server not visible</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/temporary-tables-SQL-Server-not-visible/m-p/597972#M18241</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Ok but the neither global nor shared does work unfortunately. My problem hasn't got to do with this.&lt;/P&gt;&lt;P&gt;What I'm looking for is a libname statement to SQL server allowing me to use temp tables across all databases that are available in the sql server instance.&lt;/P&gt;&lt;P&gt;The only thing that i've got working right now is temp tables for a specific database. As soon as I use another database in the explicit passthrough it says the temp table is not available.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;William&lt;/P&gt;</description>
      <pubDate>Sun, 20 Oct 2019 09:01:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/temporary-tables-SQL-Server-not-visible/m-p/597972#M18241</guid>
      <dc:creator>Billybob73</dc:creator>
      <dc:date>2019-10-20T09:01:53Z</dc:date>
    </item>
    <item>
      <title>Re: temporary tables SQL Server not visible</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/temporary-tables-SQL-Server-not-visible/m-p/597973#M18242</link>
      <description>&lt;P&gt;Another thing about this. I've read somewhere a connection to the TEMPDB should look something like this :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;libname TMPLIB ODBC NOPROMPT='DRIVER=SQL Server; SERVER=&amp;lt;SERVERNAME&amp;gt;; DATABASE=TEMPDB; TRUSTED_CONNECTION = yes" schema=DBO CONNECTION=GLOBAL DBMSTEMP=YES;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My suspection is that when I get this working I can use temptables across ALL databases in an SQL server instance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However right now I'm using :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;libname TMPLIB ODBC authdomain=&amp;lt;authdomain&amp;gt; dsn=&amp;lt;databasename&amp;gt; schema=dbo PRESERVER_TAB_NAMES=YES CONNECTION=GLOBAL INSERT_SQL=YES INSERTBUFF=1000 READBUFF=2500 DBSLICEPARM=(THREADED_APPS, 4);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please not that using DBMSTEMP=YES in the last libname statement causes joins with databases not to work so I have to omit this statement.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thing is that the last libname statement works and I can join within explicit passthrough statements with database tables, views. But only for the database specified in the libname statement.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Maybe this context helps to solve this matter as I keep struggling with this I cannot find any documentation on this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Rgds&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 20 Oct 2019 09:30:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/temporary-tables-SQL-Server-not-visible/m-p/597973#M18242</guid>
      <dc:creator>Billybob73</dc:creator>
      <dc:date>2019-10-20T09:30:37Z</dc:date>
    </item>
    <item>
      <title>Re: temporary tables SQL Server not visible</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/temporary-tables-SQL-Server-not-visible/m-p/598004#M18243</link>
      <description>&lt;P&gt;If using DBMSTEMP=YES as libname option then ALL tables created under this libref are temporary. Or use a libref without DBMSTEMP and the ## notation. That should work as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For joining with a temporary table from the docu &lt;A href="https://go.documentation.sas.com/?docsetId=acreldb&amp;amp;docsetTarget=p0he4t6yjfmkhpn16qrf0cdhllu6.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_self"&gt;here&lt;/A&gt;:&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;To join a temporary table and a permanent table, you need a &lt;STRONG&gt;libref for each table&lt;/STRONG&gt; and these librefs must successfully share a global connection.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 20 Oct 2019 22:17:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/temporary-tables-SQL-Server-not-visible/m-p/598004#M18243</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2019-10-20T22:17:05Z</dc:date>
    </item>
  </channel>
</rss>

