locked
Tracking table is empty after insert/update/delete RRS feed

  • Question

  • I've provisioned a SQL 2005 database (2 tables) using the SqlSyncScopeProvisioning class like i've done 20 times without problems

    facts:
    - The database is being used by a C5 system
    - The 2 Tables are Tables that are used by C5
    - I've selected 2 colums to make a unique key (the tables didn't have a unique key before)
    - the provisioning has added all the triggers, SP's and the _tracking tables
    - the tables contains data in both ends (local + remote) before provisioning and they are in sync.
    - The syncdirection is set to Upload only

    Now my big question is:

    Why does nothing happen when i Insert, Update or Delete ???

    the _Tracking tables are empty !!
    Wednesday, March 17, 2010 2:47 PM

Answers

  • when you provision, you can specify SetPopulateTrackingTableDefault to populate the tracking tables based on existing rows in the base table.
    • Marked as answer by Montago Thursday, March 18, 2010 1:54 PM
    Thursday, March 18, 2010 1:18 PM

All replies

  • 1. When you say DML is tracked by the corresponding tracking table, does this happen on the source or target server?
    2. Assume this happens on the source server, would you please turn on profiler to watch which TSQL was executed on it when you do local Insert/Update/Delete (manual changes), after you provisioned the db and table?

    Thanks.
    Leo Zhou ------ This posting is provided "AS IS" with no warranties, and confers no rights.
    Thursday, March 18, 2010 12:18 AM
    Answerer
  • 1. currently its the "Source" server... what i would call the "local" server : Tracking is tacking place in both ends though.

    2. Im no shark at profiling a SQL Server... so i'll explain exactly what i do:

    - provisioning the database, tables, columns (which creates a tracking table, triggers and some stored procedures)
    - use MS SQL Server Management Studio Express to edit some lines in the table.

    doing so on the destination server (SQL 2005 Express) - the tracking table now contains some lines...


    Thursday, March 18, 2010 8:33 AM
  • Ahhh

    i think i know the problem now...

    the UPDATE trigger is only UPDATING the data in the tracking table...

    and since i had data in the table BEFORE provisioning... no lines are added to the tracking table


    is there a way to add a line for all data in the table, to the tracking table ?
    Thursday, March 18, 2010 8:51 AM
  • when you provision, you can specify SetPopulateTrackingTableDefault to populate the tracking tables based on existing rows in the base table.
    • Marked as answer by Montago Thursday, March 18, 2010 1:54 PM
    Thursday, March 18, 2010 1:18 PM
  • Thanks !!!
    Thursday, March 18, 2010 1:54 PM