Options

Excluding Tables doesn't seem to work

faniedtfaniedt Posts: 5 New member
edited April 28, 2016 6:18AM in SQL Comparison SDK 11
I'm trying to exclude a list of tables from the compare but it doesn't seem to work. Below is my code that loops through the mappings and the datatable that contains the tablenames to exclude.
RedGate rg = new RedGate();
                DataTable dtTableToExclude = rg.GetTablesToExclude();

                for (int i = 0; i < dtTableToExclude.Rows.Count; i++)
                {
                    tableToExclude = "[dbo].[" + dtTableToExclude.Rows[i]["TableName"].ToString() + "]";

                    foreach (TableMapping m in mappings)
                    {
                        try
                        {
                            if (m.Obj1.FullyQualifiedName != null)
                            {
                                if (m.Obj1.FullyQualifiedName == tableToExclude)
                                {
                                    m.Include = false;
                                    break;
                                }
                            }
                            m.RefreshMappingStatus();

                        }

Thanks in advance ...

Comments

  • Options
    Hi,

    Could you give me some info about what exactly it is that you're trying to do? Would you be able to get your code to ignore any differences relating to the tables that you're not interested in?
    Software Engineer
    Redgate Software
Sign In or Register to comment.