locked
Temp Tables/Table vars in Filters RRS feed

  • Question

  • Hello,

     

    I'm synching about 12 joined tables.  Each call to Select Incremental Insert/Updates requires all the tables be joined to do the needed filtering.  We are using indexes, but considering the 12 tables and calls for Insert, Update and Delete, this requires 36 complex joins.

     

    All but one of the joins could be avoided through use of table variables or temp tables that persist between the calls to Select Incremental Insert and update for each of the tables.  Is there a way to do this ? 

     

    Without doing anything special, it appears that table variables created in calls to Select Incremental Insert/Updates for the initial tables are not available in calls to Select Incremental Insert/Updates for later tables. 

     

    The trace output appears to show a connection is openned at the first select Incremental Inserts and stays open till closed at the Select Deletes for the last table.  I'd hope that table variables would persist, but they do not appear to.

     

    Thanks for any help with this.

     

     

    • Moved by Hengzhe Li Friday, April 22, 2011 6:34 AM (From:SyncFx - Microsoft Sync Framework Database Providers [ReadOnly])
    Monday, December 29, 2008 5:11 AM

All replies

  • Sorry for not replying on time.

     

    are you using Peer to Peer sync ?

     

    so if i understand your post correctly, you need all those table names so that you can construct the query with 12-table-join, right ?

     

     

    thanks

    yunwen

     

    Monday, January 12, 2009 7:53 PM
    Moderator