<?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: How to update the table in sas which is from SQL Server? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/How-to-update-the-table-in-sas-which-is-from-SQL-Server/m-p/185252#M47050</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jaap Karman has provided there reason behind this, I would want to ask why you are changing a database table from SAS?&amp;nbsp; Doesn't sound like a good idea to me, use the database functionality to update tables, that way you can hit all the hooks from the, e.g. audit trail updates etc.&amp;nbsp; If you want to work with the data in SAS, access it an store it in SAS, then do what you want with it.&amp;nbsp; Try to avoid overlapping the two.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 27 Feb 2015 13:44:45 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2015-02-27T13:44:45Z</dc:date>
    <item>
      <title>How to update the table in sas which is from SQL Server?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-update-the-table-in-sas-which-is-from-SQL-Server/m-p/185250#M47048</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;Hi all,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;In my case the table which i am using is on SQL Server. Using libname statement i access that table. Whenever i make any modification to that table, SAS throws an &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt;"&gt;Error:- the ODBC table has been output. This table already exists,there in name conflicts with existing objects.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt;"&gt;This table will not be replaced. This engine doesn't support REPLACE Option&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;How to resolve it.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;Thanks in advance &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Feb 2015 06:20:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-update-the-table-in-sas-which-is-from-SQL-Server/m-p/185250#M47048</guid>
      <dc:creator>samirt</dc:creator>
      <dc:date>2015-02-27T06:20:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to update the table in sas which is from SQL Server?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-update-the-table-in-sas-which-is-from-SQL-Server/m-p/185251#M47049</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is a contradiction with a RDBMS - SAS. SAS is designed to replace full tables when a record is changing. An RDBMS is designed with OLTP only updating one record for every record change.&lt;/P&gt;&lt;P&gt;You cannot solve that different desigg as a result of different goals. You should behave with your code accordingly to those designs.&lt;/P&gt;&lt;P&gt;Replacing a dataset while updating that data (datstep) is allowed in a SAS datastep but should be avoided at all with SQL. Use other tablenames.&lt;/P&gt;&lt;P&gt;If you are updating one record with SAS than use updated in place (modify that one) and use locking at record level as the RDBMS interface does need that.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Feb 2015 12:55:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-update-the-table-in-sas-which-is-from-SQL-Server/m-p/185251#M47049</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2015-02-27T12:55:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to update the table in sas which is from SQL Server?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-update-the-table-in-sas-which-is-from-SQL-Server/m-p/185252#M47050</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jaap Karman has provided there reason behind this, I would want to ask why you are changing a database table from SAS?&amp;nbsp; Doesn't sound like a good idea to me, use the database functionality to update tables, that way you can hit all the hooks from the, e.g. audit trail updates etc.&amp;nbsp; If you want to work with the data in SAS, access it an store it in SAS, then do what you want with it.&amp;nbsp; Try to avoid overlapping the two.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Feb 2015 13:44:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-update-the-table-in-sas-which-is-from-SQL-Server/m-p/185252#M47050</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-02-27T13:44:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to update the table in sas which is from SQL Server?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-update-the-table-in-sas-which-is-from-SQL-Server/m-p/185253#M47051</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the reply&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am having a table named sample in sql which is having a field name Date. From which i wanted to extract month number using sas language. The following is the&amp;nbsp; code which&amp;nbsp; i am using&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;libname top odbc datasrc=xx&amp;nbsp; user=xxx password=xxx;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; alter table top.sample&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; add mon num ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; update top.sample&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set mon=month(date);&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SAS is throwing a&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;ERROR:- The header/variable is not supported by ODBC function&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ERROR:- View sample cannot be altered&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Mar 2015 06:24:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-update-the-table-in-sas-which-is-from-SQL-Server/m-p/185253#M47051</guid>
      <dc:creator>samirt</dc:creator>
      <dc:date>2015-03-02T06:24:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to update the table in sas which is from SQL Server?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-update-the-table-in-sas-which-is-from-SQL-Server/m-p/185254#M47052</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If the table already exists, you must use either proc SQL or proc append. Try a "little" table first (because of insertbuff option and bulkload option &lt;A href="http://support.sas.com/documentation/cdl/en/acreldb/63647/HTML/default/viewer.htm#a001371584.htm" title="http://support.sas.com/documentation/cdl/en/acreldb/63647/HTML/default/viewer.htm#a001371584.htm"&gt;SAS/ACCESS(R) 9.2 for Relational Databases: Reference, Fourth Edition&lt;/A&gt;)&amp;nbsp; and use something like this:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;* Please rectify your Libnames etc. first!;&lt;/P&gt;&lt;P&gt;Libname YOUR_LIBNAME ODBC Schema=DBO DSN=YOUR_SQL_STAGING_AREA;&lt;/P&gt;&lt;P&gt;Proc SQL;&lt;BR /&gt;&amp;nbsp; Insert Into YOUR_LIBNAME.YOUR_SQL_TABLE Select * From YOUR_SAS_TABLE;&lt;BR /&gt;Quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Mar 2015 08:17:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-update-the-table-in-sas-which-is-from-SQL-Server/m-p/185254#M47052</guid>
      <dc:creator>user24feb</dc:creator>
      <dc:date>2015-03-02T08:17:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to update the table in sas which is from SQL Server?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-update-the-table-in-sas-which-is-from-SQL-Server/m-p/185255#M47053</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It's not unusual to have SAS to refresh tables in an external RDBMS. It could be a architectural decision to keep staing tables there. Refresh strategies could also apply to some data mart structures.&lt;/P&gt;&lt;P&gt;But most DBA's don't like replacing tables, so a truncate/insert strategy would have a better chance to get you popular with those guys.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Mar 2015 08:36:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-update-the-table-in-sas-which-is-from-SQL-Server/m-p/185255#M47053</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2015-03-02T08:36:39Z</dc:date>
    </item>
  </channel>
</rss>

