none
How do i delete a Scope and remove Sync tables ? RRS feed

Answers

  • I guess these are the official docs: http://msdn.microsoft.com/en-au/library/bb726035(SQL.105).aspx
    Although not much help imho, as even MSFT is mixing information about the 'Offline' and 'Collaboration' scenario's.

    And if you set the serverConfig.SetCreateTrackingTableDefault(DbSyncCreationOption.Skip);

    Thursday, January 14, 2010 2:42 PM
  • private void RemoveScope(SqlConnection Conn, bool ShowAlert)
    {
      foreach (var table in _settings.TablesToSync)
      {
        SqlCommand dropTracking = new SqlCommand(@"
          IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[" + table.Key + @"_tracking]') AND type in (N'U'))
          DROP TABLE [dbo].[" + table.Key + "_tracking]", Conn);
        dropTracking.ExecuteNonQuery();
    
        SqlCommand dropTriggers = new SqlCommand(@"
          IF EXISTS (SELECT * FROM sys.triggers WHERE object_id = OBJECT_ID(N'[dbo].[" + table.Key + @"_delete_trigger]'))
          DROP TRIGGER [dbo].[" + table.Key + @"_delete_trigger];
    
          IF EXISTS (SELECT * FROM sys.triggers WHERE object_id = OBJECT_ID(N'[dbo].[" + table.Key + @"_insert_trigger]'))
          DROP TRIGGER [dbo].[" + table.Key + @"_insert_trigger];
    
          IF EXISTS (SELECT * FROM sys.triggers WHERE object_id = OBJECT_ID(N'[dbo].[" + table.Key + @"_update_trigger]'))
          DROP TRIGGER [dbo].[" + table.Key + @"_update_trigger];
        ", Conn);
        dropTriggers.ExecuteNonQuery();
    
        SqlCommand dropStoredProc = new SqlCommand(@"
          IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[" + table.Key + @"_delete]') AND type in (N'P', N'PC'))
          DROP PROCEDURE [dbo].[" + table.Key + @"_delete];
    
          IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[" + table.Key + @"_deletemetadata]') AND type in (N'P', N'PC'))
          DROP PROCEDURE [dbo].[" + table.Key + @"_deletemetadata];
    
          IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[" + table.Key + @"_insert]') AND type in (N'P', N'PC'))
          DROP PROCEDURE [dbo].[" + table.Key + @"_insert];
    
          IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[" + table.Key + @"_insertmetadata]') AND type in (N'P', N'PC'))
          DROP PROCEDURE [dbo].[" + table.Key + @"_insertmetadata];
    
          IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[" + table.Key + @"_selectchanges]') AND type in (N'P', N'PC'))
          DROP PROCEDURE [dbo].[" + table.Key + @"_selectchanges];
    
          IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[" + table.Key + @"_selectrow]') AND type in (N'P', N'PC'))
          DROP PROCEDURE [dbo].[" + table.Key + @"_selectrow];
    
          IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[" + table.Key + @"_update]') AND type in (N'P', N'PC'))
          DROP PROCEDURE [dbo].[" + table.Key + @"_update];
    
          IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[" + table.Key + @"_updatemetadata]') AND type in (N'P', N'PC'))
          DROP PROCEDURE [dbo].[" + table.Key + @"_updatemetadata];
        ", Conn);
        dropStoredProc.ExecuteNonQuery();
      }
    
      SqlCommand getScopeGuid = new SqlCommand(@"
          USE [" + Conn.Database + @"]
          SELECT scope_config_id FROM scope_info WHERE scope_name = '" + _settings.ScopeName + "'", Conn);
    
      var reader = getScopeGuid.ExecuteReader();
    
      if (reader.HasRows)
      {
        reader.Read();
    
        var id = reader.GetGuid(0);
    
        reader.Close();
    
        SqlCommand deleteScope = new SqlCommand(@"
            DELETE FROM scope_info WHERE scope_config_id = '" + id + @"';
            DELETE FROM scope_config WHERE config_id = '" + id + @"';
          ", Conn);
        deleteScope.ExecuteNonQuery();
      }
    
      if(ShowAlert)
        MessageBox.Show("Scope has been removed");
    }
    • Marked as answer by Montago Tuesday, June 15, 2010 6:43 AM
    Tuesday, June 15, 2010 6:43 AM

All replies

  • No.

    The docs (somewhere) even state that you should not delete a scope unless you are absolutely sure that it will never be used to sync ever again.

    (in the case of having to start over provisioning a database, I just recreate the database again completely, and then apply the new scope provisioning on it)

    HTH
    Tuesday, January 12, 2010 3:54 PM
  • Heh... That makes it harder to create a Utility/Program for setting up Scopes and Sync'ing....


    What do i do if i want to change a Scope ? or edit the Tables/Columns ???


    Let's say the tables are used in a development scenario, and i need to change some of the tables, or add tables to a scope... then what ?


    Thanks
    Tuesday, January 12, 2010 9:34 PM
  • According to my understanding, what you need to do is create a new scope (each time the schema changes or more tables are added), provision the server and clients again for that scope, and start using that scope to sync.

    If you are absolutely sure that the old scope will never be used again, you should be able to clean up the scope_info and scope_config tables, deleting the 'old' scope rows. As for the _tracking tables generated, if a table is *again* never to be involved in a sync, you can drop the table from the database and drop the triggers from the base table.

    R.
    Wednesday, January 13, 2010 1:44 PM
  • I guess i'll need to do some researching in whats up/down in this matter...

    it seems as if, the MSF is only able to setup a sync scenario onto a "finished" database - which aren't going to change design/layout after the initialization.

    ...

    edit:

    okay, I've tested something...

    I created a database with 2 columns + one index on the Local and Remote SQL servers.
    I Provisioned the serves and did a sync.

    I then added a column both places and added some data...

    MSF then reported 5 changes - but NONE was saved ?!?!? !!


    now im going to try to re-provision the same tables
    ...

    Edit:

    Doing a Re-provisioning is impossible.
    doing a Post-Restore Fix didn't help either...
    Wednesday, January 13, 2010 1:49 PM
  • Hi Montango,

    Did you also try creating a new scope, provisioning that one, and using the new scope to sync?
    e.g. You create a table 'orders' with an order_id and order_date, and in the Sync App defined:
            private void EnsureScopeDescription(string scopeName, SqlConnection clientConnection, SqlConnection serverConnection)
            {
                //create a new scope description and add the appropriate tables to this scope
                DbSyncScopeDescription scopeDesc = new DbSyncScopeDescription(scopeName);
                //add the approrpiate tables to this scope
                scopeDesc.Tables.Add(SqlSyncDescriptionBuilder.GetDescriptionForTable("orders", serverConnection));
                //scopeDesc.Tables.Add(SqlSyncDescriptionBuilder.GetDescriptionForTable("order_details", serverConnection));
    
                //class to be used to provision the scope defined above
                SqlSyncScopeProvisioning serverConfig = new SqlSyncScopeProvisioning();
    
                //determine if this scope already exists on the server and if not go ahead and provision
                if (!serverConfig.ScopeExists(scopeName, serverConnection))
                {
                    //note that it is important to call this after the tables have been added to the scope
                    serverConfig.PopulateFromScopeDescription(scopeDesc);
                    serverConfig.SetCreateTableDefault(DbSyncCreationOption.Skip);
    
                    //provision the server
                    serverConfig.Apply(serverConnection);
                }
    
                //determine if this scope already exists on the client and if not go ahead and provision
                if (!serverConfig.ScopeExists(scopeName, clientConnection))
                {
                    //note that it is important to call this after the tables have been added to the scope
                    serverConfig.PopulateFromScopeDescription(scopeDesc);
                    serverConfig.SetCreateTableDefault(DbSyncCreationOption.Skip);
    
                    //provision the server
                    serverConfig.Apply(clientConnection);
                }
            }
    And in your application you have defined
    string scopeName = "SyncScope_1";
    and you call the EnsureScopeDescription method before the Sync (I do this before every sync currently)

    Then you alter the table 'orders' by adding a new column, say 'order_completed', both on the Server and on the Client.
    Update the application to have
    string scopeName = "SyncScope_2";
    And run the application again.

    I'm very interested in the results. Because there must be a way to move the schema forward and keep on syncing, right?!
    • Proposed as answer by Rudi - Euricom Thursday, January 14, 2010 8:51 AM
    Thursday, January 14, 2010 8:51 AM
  • if i try to provision a database with the same tables from an earlier scope i get the exception:

    There is already an object named 'Table_1_tracking' in the database.


    * Table_1 is my test tablename
    Thursday, January 14, 2010 9:08 AM
  • Here is the thread where I read that changing a scope cannot be done:
    http://social.microsoft.com/Forums/en-US/syncgeneral/thread/b6250dd2-2134-43b3-80e9-7fd2bf4ec133

    So maybe using the correct options of not recreating the tables as in the above post, you can achieve creating the new scope.
    After all, the 'Table_1_tracking' table does not need to be updated.

    Good luck.
    Thursday, January 14, 2010 2:15 PM
  • Hey thanks...

    the funny thing is that my default action already is Skip : 

    SqlSyncScopeProvisioning serverConfig = new SqlSyncScopeProvisioning(scopeDesc);
    serverConfig.SetCreateTableDefault(DbSyncCreationOption.Skip);

    even with this option, the tables get created and the error occurs. 
    I haven't tried manually setting the skip option on the tables though... 


    weird... 


    ---------

    even if i skip the tables... I'll need to redo EVERYTHING if i change a column, no ?... since this procedure only support adding a table.
    Thursday, January 14, 2010 2:24 PM
  • I guess these are the official docs: http://msdn.microsoft.com/en-au/library/bb726035(SQL.105).aspx
    Although not much help imho, as even MSFT is mixing information about the 'Offline' and 'Collaboration' scenario's.

    And if you set the serverConfig.SetCreateTrackingTableDefault(DbSyncCreationOption.Skip);

    Thursday, January 14, 2010 2:42 PM
  • ahh thanks !

    that helped a bit :)


    --

    one wish for MSF to become a bigger success would be better documentation and presentation of how to use it.... at this point in time, its a steep learning curve imho. !

    took me 5 working days to find a link to MSDN which covers the usecase I'm working on. 
    Monday, January 18, 2010 8:43 AM
  • private void RemoveScope(SqlConnection Conn, bool ShowAlert)
    {
      foreach (var table in _settings.TablesToSync)
      {
        SqlCommand dropTracking = new SqlCommand(@"
          IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[" + table.Key + @"_tracking]') AND type in (N'U'))
          DROP TABLE [dbo].[" + table.Key + "_tracking]", Conn);
        dropTracking.ExecuteNonQuery();
    
        SqlCommand dropTriggers = new SqlCommand(@"
          IF EXISTS (SELECT * FROM sys.triggers WHERE object_id = OBJECT_ID(N'[dbo].[" + table.Key + @"_delete_trigger]'))
          DROP TRIGGER [dbo].[" + table.Key + @"_delete_trigger];
    
          IF EXISTS (SELECT * FROM sys.triggers WHERE object_id = OBJECT_ID(N'[dbo].[" + table.Key + @"_insert_trigger]'))
          DROP TRIGGER [dbo].[" + table.Key + @"_insert_trigger];
    
          IF EXISTS (SELECT * FROM sys.triggers WHERE object_id = OBJECT_ID(N'[dbo].[" + table.Key + @"_update_trigger]'))
          DROP TRIGGER [dbo].[" + table.Key + @"_update_trigger];
        ", Conn);
        dropTriggers.ExecuteNonQuery();
    
        SqlCommand dropStoredProc = new SqlCommand(@"
          IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[" + table.Key + @"_delete]') AND type in (N'P', N'PC'))
          DROP PROCEDURE [dbo].[" + table.Key + @"_delete];
    
          IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[" + table.Key + @"_deletemetadata]') AND type in (N'P', N'PC'))
          DROP PROCEDURE [dbo].[" + table.Key + @"_deletemetadata];
    
          IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[" + table.Key + @"_insert]') AND type in (N'P', N'PC'))
          DROP PROCEDURE [dbo].[" + table.Key + @"_insert];
    
          IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[" + table.Key + @"_insertmetadata]') AND type in (N'P', N'PC'))
          DROP PROCEDURE [dbo].[" + table.Key + @"_insertmetadata];
    
          IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[" + table.Key + @"_selectchanges]') AND type in (N'P', N'PC'))
          DROP PROCEDURE [dbo].[" + table.Key + @"_selectchanges];
    
          IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[" + table.Key + @"_selectrow]') AND type in (N'P', N'PC'))
          DROP PROCEDURE [dbo].[" + table.Key + @"_selectrow];
    
          IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[" + table.Key + @"_update]') AND type in (N'P', N'PC'))
          DROP PROCEDURE [dbo].[" + table.Key + @"_update];
    
          IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[" + table.Key + @"_updatemetadata]') AND type in (N'P', N'PC'))
          DROP PROCEDURE [dbo].[" + table.Key + @"_updatemetadata];
        ", Conn);
        dropStoredProc.ExecuteNonQuery();
      }
    
      SqlCommand getScopeGuid = new SqlCommand(@"
          USE [" + Conn.Database + @"]
          SELECT scope_config_id FROM scope_info WHERE scope_name = '" + _settings.ScopeName + "'", Conn);
    
      var reader = getScopeGuid.ExecuteReader();
    
      if (reader.HasRows)
      {
        reader.Read();
    
        var id = reader.GetGuid(0);
    
        reader.Close();
    
        SqlCommand deleteScope = new SqlCommand(@"
            DELETE FROM scope_info WHERE scope_config_id = '" + id + @"';
            DELETE FROM scope_config WHERE config_id = '" + id + @"';
          ", Conn);
        deleteScope.ExecuteNonQuery();
      }
    
      if(ShowAlert)
        MessageBox.Show("Scope has been removed");
    }
    • Marked as answer by Montago Tuesday, June 15, 2010 6:43 AM
    Tuesday, June 15, 2010 6:43 AM
  • Hey Montago,

    your code was a great start for me i had to add a few more statements when cleaning up Azure tables below is the updated function, thanks again:

     

     

    static private void RemoveScope(SqlConnection Conn, bool ShowAlert, List<string> tablesToRemoveScropt, string scopeName)
        {            
          foreach (string table in tablesToRemoveScropt)
          {
            SqlCommand dropTracking = new SqlCommand(@"
            IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[" + table + @"_tracking]') AND type in (N'U'))
            DROP TABLE [dbo].[" + table + "_tracking]", Conn);
            dropTracking.ExecuteNonQuery();
           
            SqlCommand dropTriggers = new SqlCommand(@"
            IF EXISTS (SELECT * FROM sys.triggers WHERE object_id = OBJECT_ID(N'[dbo].[" + table + @"_delete_trigger]'))
            DROP TRIGGER [dbo].[" + table + @"_delete_trigger];
    
            IF EXISTS (SELECT * FROM sys.triggers WHERE object_id = OBJECT_ID(N'[dbo].[" + table + @"_insert_trigger]'))
            DROP TRIGGER [dbo].[" + table + @"_insert_trigger];
    
            IF EXISTS (SELECT * FROM sys.triggers WHERE object_id = OBJECT_ID(N'[dbo].[" + table + @"_update_trigger]'))
            DROP TRIGGER [dbo].[" + table + @"_update_trigger];
            ", Conn);
            dropTriggers.ExecuteNonQuery();
    
            SqlCommand dropStoredProc = new SqlCommand(@"
            IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[" + table + @"_delete]') AND type in (N'P', N'PC'))
            DROP PROCEDURE [dbo].[" + table + @"_delete];
      
            IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[" + table + @"_deletemetadata]') AND type in (N'P', N'PC'))
            DROP PROCEDURE [dbo].[" + table + @"_deletemetadata];
    
            IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[" + table + @"_insert]') AND type in (N'P', N'PC'))
            DROP PROCEDURE [dbo].[" + table + @"_insert];
    
            IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[" + table + @"_insertmetadata]') AND type in (N'P', N'PC'))
            DROP PROCEDURE [dbo].[" + table + @"_insertmetadata];
    
            IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[" + table + @"_selectchanges]') AND type in (N'P', N'PC'))
            DROP PROCEDURE [dbo].[" + table + @"_selectchanges];
    
            IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[" + table + @"_selectrow]') AND type in (N'P', N'PC'))
            DROP PROCEDURE [dbo].[" + table + @"_selectrow];
    
            IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[" + table + @"_update]') AND type in (N'P', N'PC'))
            DROP PROCEDURE [dbo].[" + table + @"_update];
    
            IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[" + table + @"_bulkdelete]') AND type in (N'P', N'PC'))
            DROP PROCEDURE [dbo].[" + table + @"_bulkdelete];
    
            IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[" + table + @"_bulkupsert]') AND type in (N'P', N'PC'))
            DROP PROCEDURE [dbo].[" + table + @"_bulkupsert];
    
            IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[" + table + @"_delete_multiple]') AND type in (N'P', N'PC'))
            DROP PROCEDURE [dbo].[" + table + @"_delete_multiple];
    
            IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[" + table + @"_insert_multiple]') AND type in (N'P', N'PC'))
            DROP PROCEDURE [dbo].[" + table + @"_insert_multiple];
    
            IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[" + table + @"_update_multiple]') AND type in (N'P', N'PC'))
            DROP PROCEDURE [dbo].[" + table + @"_update_multiple];
    
            IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[" + table + @"_updatemetadata]') AND type in (N'P', N'PC'))
            DROP PROCEDURE [dbo].[" + table + @"_updatemetadata];
            ", Conn);
            dropStoredProc.ExecuteNonQuery();
    
            SqlCommand dropType = new SqlCommand(@"
            IF EXISTS (SELECT * FROM sys.table_types WHERE name = '" + table + @"_SyncType')
            DROP TYPE " + table + @"_SyncType;", Conn);
            dropType.ExecuteNonQuery();
            
          }
    
          SqlCommand getScopeGuid = new SqlCommand(@"
          USE [" + Conn.Database + @"]
          SELECT scope_config_id FROM scope_info WHERE scope_name = '" + scopeName + "'", Conn);
    
          var reader = getScopeGuid.ExecuteReader();
          if (reader.HasRows)
          {
            reader.Read();
    
            var id = reader.GetGuid(0);
    
            reader.Close();
    
            SqlCommand deleteScope = new SqlCommand(@"
            DELETE FROM scope_info WHERE scope_config_id = '" + id + @"';
            DELETE FROM scope_config WHERE config_id = '" + id + @"';
            ", Conn);
            deleteScope.ExecuteNonQuery();
          }  
              
          if (ShowAlert)
            MessageBox.Show("Scope has been removed");
        }

    • Edited by alsodev Thursday, July 8, 2010 2:40 AM changed it to be code field
    Thursday, July 8, 2010 2:18 AM
  • Hi,

    A question...

    I use MSF to synchronize a server with SQL Server Express 2008 and 3 clients also with SQL Server Express 2008.

    For example : just one table WCF_TABLE with two fields WT_ID IDENTITY and WT_FIELD1 VARCHAR.

    I want to adapt scopes on both sides to follow schema modifications such as field adding.

    In order to adapt the scopes with schema modifications, I use the previous code to delete the scopes and then create it again on the same scope name, on the same table with just one more field : WT_FIELD2 VARCHAR. I adapt that script and add stored procedure drop to XXX_bulkinsert et XXX_bulk_update.

    After running scope deletion, I check the master and client DB to verifiy that no table, field and metadata are present.

    The problem is when I create that new scope, I get an error saying : "Invalid field name : WT_FIELD2" when creating "WCF_TABLE_bulkinsert" stored procedure.

    When I manually launch the SQL query that is used to create that stored procedure, it works...

    Any idea please ?

    Thanks a lot.

    Best regards

    Sunday, February 6, 2011 1:58 AM
  • Hi everybody,

    If somebody is interested about the previous question, I think I have the answer...

    MSF seems to add user defined types for every synchronised table. This type contains all fields when the scope is created.

    So, if we drop the scope, modify schema, such as field adding, this user type appears to be obsolete.

    In order to be able to create the scope again, we will have to drop this defined type and add some lines to the previous code :

    IF EXISTS (SELECT * FROM sys.types st JOIN sys.schemas ss ON st.schema_id = ss.schema_id WHERE st.name = N'"

     

     

    + table + @"_BulkType' AND ss.name = N'dbo')

    DROP TYPE [dbo].["

     

     

    + table + @"_BulkType];

     

     

     

    To give all information, here are the lines I added to the previous code to drop some other stored procedures :

    IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[" + table + @"_bulkinsert]') AND type in (N'P', N'PC'))

    DROP PROCEDURE [dbo].["

     

     

    + table + @"_bulkinsert];

    IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].["

     

     

    + table + @"_bulkupdate]') AND type in (N'P', N'PC'))

    DROP PROCEDURE [dbo].["

     

     

    + table + @"_bulkupdate];

     

     

     

    Hope it will be useful... :)

    Best regards

    David

    Sunday, February 6, 2011 6:35 PM
  • Sync Fx 2.1 already includes deprovisioning APIs which should take care of cleaning up sync fx related objects without having to fire individual drop statements.
    Monday, February 7, 2011 12:21 PM
    Moderator
  • Yeah...

    but this question started when SyncFX was at version 2.0

    These manual scripts are useful if you need to Re-Provision a database without removing the metadata (maybe also for other purposes)

     

    Although... I guess one could use the new function to remove the scope - i haven't tried 

    Monday, February 7, 2011 12:37 PM
  • Great !

    I didn't known it was possible with some new functions.

    Any idea about the name of these functions / interface ?

    I'll search, try and give feedback.

    David

    Monday, February 7, 2011 3:40 PM
  • DeprovisionScope, DeprovisionTemplate, DeprovisionStore
    Monday, February 7, 2011 11:19 PM
    Moderator
  • I've just being tested the DeprovisionScope function.

    It seems working as well as I was looking for, to deprovision the scopes on both sides (server and client). No trace of any metadata, stored procedures, triggers... Everything seems to be deleted...

    However, the previous code (with SQL script inside), gave me the idea of being able to only delete the table definition from the scope. I've not tested, I'm going to do so asap. Moreover, maybe the DeprovisionTemplate will be useful to do that... ?

    To be clear, my wish is to be able to adapt synchronisation mechanism with schema's modifications on both sides. I wish only update scopes of the updated table schema, not the whole scope (all tables).

    Maybe somebody can give me advices...

    I'll try with the code (with SQL script inside) and send feedback.

    Thank you

    Tuesday, February 8, 2011 12:39 PM