<?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: Optimizing the job to load data to SQL Server using SAS Enterprise Guide in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Optimizing-the-job-to-load-data-to-SQL-Server-using-SAS/m-p/673306#M202526</link>
    <description>&lt;P&gt;Please post your passthru code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your SAS SQL version indicates you are reading all of your SQL Server data into SAS, then immediately writing it back to SQL Server. With passthru you should be able to read data directly from one SQL Server table and write it into another without extracting it to SAS.&lt;/P&gt;</description>
    <pubDate>Wed, 29 Jul 2020 20:38:46 GMT</pubDate>
    <dc:creator>SASKiwi</dc:creator>
    <dc:date>2020-07-29T20:38:46Z</dc:date>
    <item>
      <title>Optimizing the job to load data to SQL Server using SAS Enterprise Guide</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Optimizing-the-job-to-load-data-to-SQL-Server-using-SAS/m-p/673062#M202395</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I'm bulk loading approximately 60 million records to SQL database using EG and it's taking 5 hours to have the job run successfully.&lt;/P&gt;&lt;P&gt;Please suggest me the tips to optimize the run time.&lt;/P&gt;&lt;P&gt;Environment - SAS 9.4 M6, Grid&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;options fullstimer;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;libname &lt;STRONG&gt;abc&lt;/STRONG&gt; odbc noprompt= "Driver=xxxxx; Server=yyyyy; database=&lt;STRONG&gt;zzzzz&lt;/STRONG&gt;; Trusted_connection=Yes" READBUFF=32767 INSERTBUFF=32767 DBCOMMIT=32767 schema=pqr;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;libname &lt;STRONG&gt;xyz&lt;/STRONG&gt; odbc noprompt= "Driver=xxxxx; Server=yyyyy; database=&lt;STRONG&gt;ggggg&lt;/STRONG&gt;; Trusted_connection=Yes" READBUFF=32767 INSERTBUFF=32767 DBCOMMIT=32767 schema=pqr;&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;proc sql;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;drop table xyz.table_name;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;quit;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;data xyz.table_name;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;set abc.table_name;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;run;&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jul 2020 09:07:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Optimizing-the-job-to-load-data-to-SQL-Server-using-SAS/m-p/673062#M202395</guid>
      <dc:creator>Akshay1002</dc:creator>
      <dc:date>2020-07-29T09:07:45Z</dc:date>
    </item>
    <item>
      <title>Re: Optimizing the job to load data to SQL Server using SAS Enterprise Guide</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Optimizing-the-job-to-load-data-to-SQL-Server-using-SAS/m-p/673071#M202400</link>
      <description>&lt;P&gt;You are copying from SQL Server to SQL Server. Can't you use explicit pass-through, i.e send pure SQL Server code?&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jul 2020 09:54:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Optimizing-the-job-to-load-data-to-SQL-Server-using-SAS/m-p/673071#M202400</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-07-29T09:54:20Z</dc:date>
    </item>
    <item>
      <title>Re: Optimizing the job to load data to SQL Server using SAS Enterprise Guide</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Optimizing-the-job-to-load-data-to-SQL-Server-using-SAS/m-p/673211#M202472</link>
      <description>Yes,&lt;BR /&gt;We did try the pass through option. The results are still the same.</description>
      <pubDate>Wed, 29 Jul 2020 16:52:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Optimizing-the-job-to-load-data-to-SQL-Server-using-SAS/m-p/673211#M202472</guid>
      <dc:creator>Akshay1002</dc:creator>
      <dc:date>2020-07-29T16:52:24Z</dc:date>
    </item>
    <item>
      <title>Re: Optimizing the job to load data to SQL Server using SAS Enterprise Guide</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Optimizing-the-job-to-load-data-to-SQL-Server-using-SAS/m-p/673306#M202526</link>
      <description>&lt;P&gt;Please post your passthru code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your SAS SQL version indicates you are reading all of your SQL Server data into SAS, then immediately writing it back to SQL Server. With passthru you should be able to read data directly from one SQL Server table and write it into another without extracting it to SAS.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jul 2020 20:38:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Optimizing-the-job-to-load-data-to-SQL-Server-using-SAS/m-p/673306#M202526</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2020-07-29T20:38:46Z</dc:date>
    </item>
    <item>
      <title>Re: Optimizing the job to load data to SQL Server using SAS Enterprise Guide</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Optimizing-the-job-to-load-data-to-SQL-Server-using-SAS/m-p/674046#M202907</link>
      <description>I'll post the pass through code soon. Sorry about the delay.&lt;BR /&gt;&lt;BR /&gt;Is it true that we need SAS/ACCESS to SQLServer engine inorder to bulkload data into SQL databases? And we don't have it in our environment.</description>
      <pubDate>Mon, 03 Aug 2020 05:10:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Optimizing-the-job-to-load-data-to-SQL-Server-using-SAS/m-p/674046#M202907</guid>
      <dc:creator>Akshay1002</dc:creator>
      <dc:date>2020-08-03T05:10:23Z</dc:date>
    </item>
    <item>
      <title>Re: Optimizing the job to load data to SQL Server using SAS Enterprise Guide</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Optimizing-the-job-to-load-data-to-SQL-Server-using-SAS/m-p/674048#M202909</link>
      <description>&lt;P&gt;You don't need BULKLOAD here as the source data is not SAS. You should be able to have all the data stay within SQL Server's realm.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Aug 2020 05:18:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Optimizing-the-job-to-load-data-to-SQL-Server-using-SAS/m-p/674048#M202909</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-08-03T05:18:24Z</dc:date>
    </item>
    <item>
      <title>Re: Optimizing the job to load data to SQL Server using SAS Enterprise Guide</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Optimizing-the-job-to-load-data-to-SQL-Server-using-SAS/m-p/674052#M202911</link>
      <description>&lt;P&gt;Ideally don't move the data from SQL Server to SAS to SQL Server but just insert from one SQL server table into another SQL server table - and as you don't move data in and out of SQL server you also don't need bulk-load.&lt;/P&gt;
&lt;P&gt;Untested but some code like below could do the job. Basically: Develop your code directly in SQL and then just copy/paste the working script into a SAS pass-through Execute block.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname xyz odbc noprompt= "Driver=xxxxx; Server=yyyyy; database=ggggg; Trusted_connection=Yes" schema=pqr; 

proc sql;
  connect using xyz;
  execute 
  (
    INSERT INTO pqr.TargetTable
       SELECT *
       FROM zzzzz.pqr.SourceTable&lt;BR /&gt;       ;
  ) by xyz
  ;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 03 Aug 2020 05:37:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Optimizing-the-job-to-load-data-to-SQL-Server-using-SAS/m-p/674052#M202911</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2020-08-03T05:37:47Z</dc:date>
    </item>
  </channel>
</rss>

