Exemple #1
0
 public bool HasDifferences(TableSizes tablesSizes)
 {
     if (tablesSizes == null)
     {
         return(true);
     }
     return(!tablesSizes.Items.OrderBy(x => x.Key.ToString()).SequenceEqual(Items.OrderBy(x => x.Key.ToString())));
     //return !RowCount.SequenceEqual(tablesSizes.RowCount);
 }
 public TableSizes GetTableSizes(DbConnection conn, LinkedDatabaseInfo linkedInfo)
 {
     var res = new TableSizes();
     using (var cmd = conn.CreateCommand())
     {
         cmd.CommandText = SqlServerLinkedServer.ReplaceLinkedServer(SqlServerDatabaseFactory.LoadEmbeddedResource("rowcounts.sql"), linkedInfo);
         using (var reader = cmd.ExecuteReader())
         {
             while (reader.Read())
             {
                 string table = reader.SafeString("Table");
                 string schema = reader.SafeString("Schema");
                 int rowcount = Int32.Parse(reader.SafeString("RowCount") ?? "0");
                 res.RowCount[new NameWithSchema(schema, table)] = rowcount;
             }
         }
     }
     return res;
 }
Exemple #3
0
 public bool HasDifferences(TableSizes tablesSizes)
 {
     return !RowCount.SequenceEqual(tablesSizes.RowCount);
 }