<?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: SQL Server OLEDB Library - SAS Passing CursorDelete to SQL Server in Administration and Deployment</title>
    <link>https://communities.sas.com/t5/Administration-and-Deployment/SQL-Server-OLEDB-Library-SAS-Passing-CursorDelete-to-SQL-Server/m-p/282109#M5382</link>
    <description>&lt;P&gt;Hello SAS Kiwi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for your reply, please see code below...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;/*APPEND TO AD_HOC DATA TO EXCLUDE FROM CI JOBS*/&lt;BR /&gt;LIBNAME Table1 OLEDB BULKLOAD=YES PROPERTIES=('Persist Security Info'=True 'Integrated Security'=SSPI 'Initial Catalog'=DBMart) &lt;BR /&gt;OLEDB_SERVICES=NO PROMPT=NO DATASOURCE='DB1' PROVIDER=SQLOLEDB.1 SCHEMA=dbo ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;/*REMOVE DATA FROM THE AD-HOC FILE TO CORRECT MISTAKES*/&lt;BR /&gt;proc sql;&lt;BR /&gt; delete&lt;BR /&gt; from &lt;SPAN&gt;Table1&lt;/SPAN&gt;.Ad_Hoc_Info&lt;BR /&gt; where&amp;nbsp;Field5 in ("L YEAR 1","L YEAR 2","L MISSING");&lt;BR /&gt;Quit;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yes you are right the user is looking at just deleting rows, We deleted approx 3million records for this user via&amp;nbsp;SQL Server Management Studio in the end, this took a few minutes to complete.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Through my testing I've not yet run the SAS delete to completion however through testing&amp;nbsp;i've identified about 1,200,000 records for deletion and via monitoring this is deleting&amp;nbsp;roughly 20,000 every 60 seconds so would take 1 hour to complete.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Many Thanks,&lt;BR /&gt;Tom&lt;/P&gt;</description>
    <pubDate>Tue, 05 Jul 2016 09:16:09 GMT</pubDate>
    <dc:creator>mrtball</dc:creator>
    <dc:date>2016-07-05T09:16:09Z</dc:date>
    <item>
      <title>SQL Server OLEDB Library - SAS Passing CursorDelete to SQL Server</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/SQL-Server-OLEDB-Library-SAS-Passing-CursorDelete-to-SQL-Server/m-p/282022#M5376</link>
      <description>&lt;P&gt;Hello All,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Following a user query linked to the&amp;nbsp;user&amp;nbsp;trying to run a delete on a SQL server source table/dataset and performing DBA analysis into how SAS is interacting with SQL Server - it appears that SAS is running the less performant CursorDelete against the table rather than a Delete and appears to be deleting data on a row by row basis.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm just wondering if anybody knows how OLEDB delete performance can be improved&amp;nbsp;when running the delete from SAS? (I've been looking at lib settings but haven't yet found anything that has dramatically improved performance)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Many Thanks,&lt;/P&gt;</description>
      <pubDate>Mon, 04 Jul 2016 16:10:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/SQL-Server-OLEDB-Library-SAS-Passing-CursorDelete-to-SQL-Server/m-p/282022#M5376</guid>
      <dc:creator>mrtball</dc:creator>
      <dc:date>2016-07-04T16:10:36Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Server OLEDB Library - SAS Passing CursorDelete to SQL Server</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/SQL-Server-OLEDB-Library-SAS-Passing-CursorDelete-to-SQL-Server/m-p/282046#M5378</link>
      <description>&lt;P&gt;Please post the query doing the delete. Also how long is the delete step running and how many rows are being deleted? Most databases contain a row by row delete function with roll back and recovery and also a table truncation for deleting all rows. I'm assuming here you are just deleting some rows.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Jul 2016 19:41:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/SQL-Server-OLEDB-Library-SAS-Passing-CursorDelete-to-SQL-Server/m-p/282046#M5378</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2016-07-04T19:41:23Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Server OLEDB Library - SAS Passing CursorDelete to SQL Server</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/SQL-Server-OLEDB-Library-SAS-Passing-CursorDelete-to-SQL-Server/m-p/282109#M5382</link>
      <description>&lt;P&gt;Hello SAS Kiwi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for your reply, please see code below...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;/*APPEND TO AD_HOC DATA TO EXCLUDE FROM CI JOBS*/&lt;BR /&gt;LIBNAME Table1 OLEDB BULKLOAD=YES PROPERTIES=('Persist Security Info'=True 'Integrated Security'=SSPI 'Initial Catalog'=DBMart) &lt;BR /&gt;OLEDB_SERVICES=NO PROMPT=NO DATASOURCE='DB1' PROVIDER=SQLOLEDB.1 SCHEMA=dbo ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;/*REMOVE DATA FROM THE AD-HOC FILE TO CORRECT MISTAKES*/&lt;BR /&gt;proc sql;&lt;BR /&gt; delete&lt;BR /&gt; from &lt;SPAN&gt;Table1&lt;/SPAN&gt;.Ad_Hoc_Info&lt;BR /&gt; where&amp;nbsp;Field5 in ("L YEAR 1","L YEAR 2","L MISSING");&lt;BR /&gt;Quit;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yes you are right the user is looking at just deleting rows, We deleted approx 3million records for this user via&amp;nbsp;SQL Server Management Studio in the end, this took a few minutes to complete.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Through my testing I've not yet run the SAS delete to completion however through testing&amp;nbsp;i've identified about 1,200,000 records for deletion and via monitoring this is deleting&amp;nbsp;roughly 20,000 every 60 seconds so would take 1 hour to complete.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Many Thanks,&lt;BR /&gt;Tom&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jul 2016 09:16:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/SQL-Server-OLEDB-Library-SAS-Passing-CursorDelete-to-SQL-Server/m-p/282109#M5382</guid>
      <dc:creator>mrtball</dc:creator>
      <dc:date>2016-07-05T09:16:09Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Server OLEDB Library - SAS Passing CursorDelete to SQL Server</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/SQL-Server-OLEDB-Library-SAS-Passing-CursorDelete-to-SQL-Server/m-p/282111#M5384</link>
      <description>Even if the SAD doc isn't clear to me, but perhaps&lt;BR /&gt;DELETE_MULT_ROWS=YES is worth a try?</description>
      <pubDate>Tue, 05 Jul 2016 09:40:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/SQL-Server-OLEDB-Library-SAS-Passing-CursorDelete-to-SQL-Server/m-p/282111#M5384</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2016-07-05T09:40:16Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Server OLEDB Library - SAS Passing CursorDelete to SQL Server</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/SQL-Server-OLEDB-Library-SAS-Passing-CursorDelete-to-SQL-Server/m-p/282113#M5385</link>
      <description>&lt;P&gt;Also i've just had a quick look at how DI studio would handle a delete within a table loader transformation, and this uses a SQL pass through.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've amended my test code to a SQL server pass through and this deleted the 1.2 million records in 35 seconds.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Many Thanks,&lt;BR /&gt;Tom&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jul 2016 09:52:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/SQL-Server-OLEDB-Library-SAS-Passing-CursorDelete-to-SQL-Server/m-p/282113#M5385</guid>
      <dc:creator>mrtball</dc:creator>
      <dc:date>2016-07-05T09:52:38Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Server OLEDB Library - SAS Passing CursorDelete to SQL Server</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/SQL-Server-OLEDB-Library-SAS-Passing-CursorDelete-to-SQL-Server/m-p/282120#M5386</link>
      <description>&lt;P&gt;Hello Linus,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried &lt;SPAN&gt;DELETE_MULT_ROWS=YES&lt;/SPAN&gt; before and have just re-tried with it and it didn't offer any substational improvements. I think I maybe thought similarily to you that this LIB settings would offer improvements.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I wonder if it's another LIB setting is cancelling this out or maybe a system option is specified which is meaning that this isn't working?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Would you expect the Proc SQL delete to work as well as a SQL pass through?&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Tom&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jul 2016 12:12:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/SQL-Server-OLEDB-Library-SAS-Passing-CursorDelete-to-SQL-Server/m-p/282120#M5386</guid>
      <dc:creator>mrtball</dc:creator>
      <dc:date>2016-07-05T12:12:22Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Server OLEDB Library - SAS Passing CursorDelete to SQL Server</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/SQL-Server-OLEDB-Library-SAS-Passing-CursorDelete-to-SQL-Server/m-p/282242#M5390</link>
      <description>If your can't improve SAS SQL via libname performance, pass through should definitely work with same performance that you experience in SQL Server. Essantially that is the equivalent to executing it on SQL Server console, just another "user interface".</description>
      <pubDate>Tue, 05 Jul 2016 18:30:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/SQL-Server-OLEDB-Library-SAS-Passing-CursorDelete-to-SQL-Server/m-p/282242#M5390</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2016-07-05T18:30:09Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Server OLEDB Library - SAS Passing CursorDelete to SQL Server</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/SQL-Server-OLEDB-Library-SAS-Passing-CursorDelete-to-SQL-Server/m-p/282274#M5391</link>
      <description>&lt;P&gt;I'd recommend trying PASSTHRU as&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13674"&gt;@LinusH﻿&lt;/a&gt;&amp;nbsp;has already mentioned. This will get you closer to what SQL Server Studio does. I'd also try using UPDATEBUFF= on the LIBNAME statement. Try setting it to say 1000.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jul 2016 19:52:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/SQL-Server-OLEDB-Library-SAS-Passing-CursorDelete-to-SQL-Server/m-p/282274#M5391</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2016-07-05T19:52:12Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Server OLEDB Library - SAS Passing CursorDelete to SQL Server</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/SQL-Server-OLEDB-Library-SAS-Passing-CursorDelete-to-SQL-Server/m-p/282372#M5400</link>
      <description>&lt;P&gt;Hello Both,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It looks like UPDATEBUFF= is limited to Oracle data sources. So the SQL Server&amp;nbsp;passthrough is the most performant way forward for us.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you both for your repsonses.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Many Thanks,&lt;/P&gt;
&lt;P&gt;Tom&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jul 2016 09:20:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/SQL-Server-OLEDB-Library-SAS-Passing-CursorDelete-to-SQL-Server/m-p/282372#M5400</guid>
      <dc:creator>mrtball</dc:creator>
      <dc:date>2016-07-06T09:20:16Z</dc:date>
    </item>
  </channel>
</rss>

