<?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 SAS 9.3 connect to SQL Server - Updates to large table hangs in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-9-3-connect-to-SQL-Server-Updates-to-large-table-hangs/m-p/670063#M201097</link>
    <description>Hi, I am using SAS 9.3 to connect to SQL Server 2017 (AWS RDS) . I run an update statement like this: libname SQL ODBC DSN=SQL_ODBC UID=UID PASSWORD=PWD DIRECT_EXE=DELETE; PROC SQL; UPDATE SQL.TAB100 SET KEY = 1 WHERE KEY IN (SELECT KEY FROM SQL.TAB200); QUIT; TAB100 has 5.3 million rows and TAB200 has 2 rows. This SAS statement just hangs for 2-3 hrs. When the update stmt is run on the SQL Server database it takes 2 sec. I have tired creating DSN with both these dlls: MSODBCSQL17.DLL and SQLNCLI11.DLL. The SAS statement hangs with both the ODBC DSNs. Could you please share your thoughts on how it could be improved. Thanks Much, Madhuri Dara</description>
    <pubDate>Fri, 17 Jul 2020 05:45:29 GMT</pubDate>
    <dc:creator>MadhuriDara</dc:creator>
    <dc:date>2020-07-17T05:45:29Z</dc:date>
    <item>
      <title>SAS 9.3 connect to SQL Server - Updates to large table hangs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-9-3-connect-to-SQL-Server-Updates-to-large-table-hangs/m-p/670063#M201097</link>
      <description>Hi, I am using SAS 9.3 to connect to SQL Server 2017 (AWS RDS) . I run an update statement like this: libname SQL ODBC DSN=SQL_ODBC UID=UID PASSWORD=PWD DIRECT_EXE=DELETE; PROC SQL; UPDATE SQL.TAB100 SET KEY = 1 WHERE KEY IN (SELECT KEY FROM SQL.TAB200); QUIT; TAB100 has 5.3 million rows and TAB200 has 2 rows. This SAS statement just hangs for 2-3 hrs. When the update stmt is run on the SQL Server database it takes 2 sec. I have tired creating DSN with both these dlls: MSODBCSQL17.DLL and SQLNCLI11.DLL. The SAS statement hangs with both the ODBC DSNs. Could you please share your thoughts on how it could be improved. Thanks Much, Madhuri Dara</description>
      <pubDate>Fri, 17 Jul 2020 05:45:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-9-3-connect-to-SQL-Server-Updates-to-large-table-hangs/m-p/670063#M201097</guid>
      <dc:creator>MadhuriDara</dc:creator>
      <dc:date>2020-07-17T05:45:29Z</dc:date>
    </item>
    <item>
      <title>Re: SAS 9.3 connect to SQL Server - Updates to large table hangs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-9-3-connect-to-SQL-Server-Updates-to-large-table-hangs/m-p/670071#M201104</link>
      <description>&lt;P&gt;There is a wonderful thing called &lt;EM&gt;formatting&lt;/EM&gt;, which is linked to another invention called &lt;EM&gt;paragraphs&lt;/EM&gt;.&lt;/P&gt;
&lt;P&gt;You should try to look into that. I hear it helps written communication.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regarding your question, you should use explicit SQL pass-through.&lt;/P&gt;
&lt;P&gt;The syntax is something like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
  connect using SQL;
  execute by SQL (
    update TAB100 set KEY = 1 where KEY in (select KEY from TAB200)
  );
quit;&amp;nbsp;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The way you wrote your query, the whole tables are sent to SAS and then back.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jul 2020 23:47:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-9-3-connect-to-SQL-Server-Updates-to-large-table-hangs/m-p/670071#M201104</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-07-17T23:47:05Z</dc:date>
    </item>
  </channel>
</rss>

