<?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>Question Re: DEFAULT TIMESTAMP &amp; Replicating Environments in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/default-timestamp-replicating-environments/qaa-p/13817368#M4848211</link>
    <description>&lt;P&gt;Awesome, thanks!  We're just looking to implement this default and had concerns of the affects replication might bring.&lt;/P&gt;</description>
    <pubDate>Wed, 27 Jan 2010 18:48:59 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-01-27T18:48:59Z</dc:date>
    <item>
      <title>DEFAULT TIMESTAMP &amp; Replicating Environments</title>
      <link>https://community.sap.com/t5/technology-q-a/default-timestamp-replicating-environments/qaq-p/13817365</link>
      <description>&lt;P&gt;I have some table  :&lt;/P&gt;

&lt;LI-CODE lang="sql"&gt;create table people
(  
    id             bigint        not null    default autoincrement,
    first_name     varchar(50)   not null,
    last_name      varchar(50)   not null,
    gender         char(1)       not null    default 'M', 
    last_update    timestamp     not null    default timestamp  
);
&lt;/LI-CODE&gt;

&lt;P&gt;What happens in a replicating environment if remote user 1 updates a row, and then replicates the change to the main site?  Does the last_update get updated AGAIN at the main site when the change arrives and is processed?&lt;/P&gt;

&lt;P&gt;Please tell me it doesn't.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jan 2010 18:35:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/default-timestamp-replicating-environments/qaq-p/13817365</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-01-27T18:35:55Z</dc:date>
    </item>
    <item>
      <title>Re: DEFAULT TIMESTAMP &amp; Replicating Environments</title>
      <link>https://community.sap.com/t5/technology-q-a/default-timestamp-replicating-environments/qaa-p/13817366#M4848209</link>
      <description>&lt;P&gt;Calvin,&lt;/P&gt;

&lt;P&gt;it doesn't.&lt;/P&gt;

&lt;P&gt;When you look at the SQL statements that are sent to the other side (by running DBREMOTE -v -o C:\\´MyLog.txt) you will notice that the receiving database gets a complete statement with the *last_update* column set. And the particular &lt;STRONG&gt;DEFAULT TIMESTAMP&lt;/STRONG&gt; default will only be applied when the column's value is not set explicetely.
So no need to worry, we have used this DEFAULT in a SQL Remote setup for years.&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;As to your new example: If the remote exeucutes the following SQL statement (say, in a client app):&lt;/P&gt;

&lt;LI-CODE lang="sql"&gt;UPDATE people SET last_name = 'Smith' WHERE id = 123450000
&lt;/LI-CODE&gt;

&lt;P&gt;then last_update will be set automatically to &lt;EM&gt;current timestamp&lt;/EM&gt; (say, to '2010-01-28 11:24:23.123456'). The transaction log will then contain something like (you could check by using DBTRAN):&lt;/P&gt;

&lt;LI-CODE lang="sql"&gt;UPDATE people SET last_name = 'Smith', last_update = '2010-01-28 11:24:23.123456'  WHERE id = 123450000
&lt;/LI-CODE&gt;

&lt;P&gt;And it's that statement that is sent to the consolidated. Obviously, the statement contains a value for the &lt;STRONG&gt;DEFAULT TIMESTAMP&lt;/STRONG&gt; column, so it doesn't update *last_update* again.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jan 2010 18:45:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/default-timestamp-replicating-environments/qaa-p/13817366#M4848209</guid>
      <dc:creator>VolkerBarth</dc:creator>
      <dc:date>2010-01-27T18:45:29Z</dc:date>
    </item>
    <item>
      <title>Re: DEFAULT TIMESTAMP &amp; Replicating Environments</title>
      <link>https://community.sap.com/t5/technology-q-a/default-timestamp-replicating-environments/qaa-p/13817367#M4848210</link>
      <description>&lt;P&gt;Your example is somewhat lacking a "real" column: You wouldn't want to update the id (as a PK field) in a SQL Remote setup, otherwise last_update wouldn't be the problem:)&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jan 2010 18:48:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/default-timestamp-replicating-environments/qaa-p/13817367#M4848210</guid>
      <dc:creator>VolkerBarth</dc:creator>
      <dc:date>2010-01-27T18:48:45Z</dc:date>
    </item>
    <item>
      <title>Re: DEFAULT TIMESTAMP &amp; Replicating Environments</title>
      <link>https://community.sap.com/t5/technology-q-a/default-timestamp-replicating-environments/qaa-p/13817368#M4848211</link>
      <description>&lt;P&gt;Awesome, thanks!  We're just looking to implement this default and had concerns of the affects replication might bring.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jan 2010 18:48:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/default-timestamp-replicating-environments/qaa-p/13817368#M4848211</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-01-27T18:48:59Z</dc:date>
    </item>
    <item>
      <title>Re: DEFAULT TIMESTAMP &amp; Replicating Environments</title>
      <link>https://community.sap.com/t5/technology-q-a/default-timestamp-replicating-environments/qaa-p/13817369#M4848212</link>
      <description>&lt;P&gt;Example updated.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jan 2010 19:40:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/default-timestamp-replicating-environments/qaa-p/13817369#M4848212</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-01-27T19:40:39Z</dc:date>
    </item>
    <item>
      <title>Re: DEFAULT TIMESTAMP &amp; Replicating Environments</title>
      <link>https://community.sap.com/t5/technology-q-a/default-timestamp-replicating-environments/qaa-p/13817370#M4848213</link>
      <description>&lt;P&gt;Just to add: We have included 3 columns in all published tables: one "dtCreated" with DEFAULT CURRENT TIMESTAMP. one "dtLastUpdated" with DEFAULT TIMESTAMP and one "origin" with DEFAULT CURRENT PUBLISHER. That makes tracking the source of inserts/updates quite easy.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jan 2010 10:06:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/default-timestamp-replicating-environments/qaa-p/13817370#M4848213</guid>
      <dc:creator>VolkerBarth</dc:creator>
      <dc:date>2010-01-28T10:06:44Z</dc:date>
    </item>
  </channel>
</rss>

