0

In my project I have to replicate a table from one server on to other. While replicating everything works except a column that is meant to show getdate() which actually shows a future time. For example when a record is saved in the publisher table it is being saved with a time that is 4 hours ahead. I am pretty sure that this issue is because of my replication set up on the table but unable to find a fix. Can anyone please help me fix this issue? Thanks

Dale K
  • 25,246
  • 15
  • 42
  • 71
sunny
  • 33
  • 7
  • What leads you to believe that it's replication? – Ben Thul Jun 25 '16 at 00:08
  • Hi Ben, this is happening only after I add the replication process to that table and if I disable all the replication stuff everything is working normal. – sunny Jun 27 '16 at 11:29
  • Very weird. I've set up dozens of publications in my day and have never seen this. Do you have any way to compare your schema before and after the change? The Red Gate SQL Compare tool, for instance. I'm suspecting a trigger, but at this point that's a SWAG. – Ben Thul Jun 27 '16 at 13:37
  • Also, what is the value that you're using for @schema_option in the article? – Ben Thul Jun 27 '16 at 13:38
  • Hi Ben @schema_option = 0x000000000803509F I tried changing the setting to True for setting:"Convert TIMESTAMP to Binary". It didnt work though. Also, to make it clear our application is an online assessment so after each question there will be data about score and time inserted into this table (publisher). This time column is working good till the last question but once it is generating a certificate and updating the rest of the columns with certification details, the time column is not updating to the right getdate(). I looked through the stored proc and its just a simple update statement. – sunny Jun 27 '16 at 14:09
  • I just ran that schema_option param through the decoder ring and nothing looks weird. Out of curiosity, what is your time zone's UTC offset? Is it 4 hours? – Ben Thul Jun 27 '16 at 14:41
  • Right When I did a sql comparision between QA (working fine) and Dev (issue) server, I found that the Stored proc on dev is using getUTCdate() which I overlooked all these days as getdate(). I am just wondering who exactly made this change just after I set up my replication process. Thanks a lot Ben for giving me confidence over the replication process. I thought I made some mistake while setting up this replication process. – sunny Jun 27 '16 at 15:27

1 Answers1

0

Turns out this is not an issue with replication the future date was because the stored proc has getUTCdate() and not the getdate().

Dale K
  • 25,246
  • 15
  • 42
  • 71
sunny
  • 33
  • 7