Skip to content

reading sysschobjs does not return rows #34

Description

@cmhapan

I am trying to read the sysschobjs table using rawdatabase. Using the sample code from http://improve.dk/orcamdf-rawdatabase-a-swiss-army-knife-for-mdf-files.

**var db = new RawDataFile(@"c:\temp\temp.mdf");
var records = db.Pages
.Where(x => x.Header.ObjectID == 34 && x.Header.Type == PageType.Data)
.SelectMany(x => x.Records);

        var rows =  records.Select(x => RawColumnParser.Parse((RawPrimaryRecord)x, new IRawType[] {
                  RawType.Int("id"),
                      RawType.NVarchar("name")
                        }));
         rows.Select(x => x["name"]).Dump();**

I had to use RawDataFile because RawDataBase was not in the code I downloaded from github.

All I get from the Dump command is this:

System.Linq.Enumerable+WhereSelectEnumerableIterator`2[OrcaMDF.RawCore.Records.RawRecord,System.Object]

I added this code to see how many records and rows were returned:

row_count = rows.Count();
record_count = records.Count();
Console.WriteLine($"Rows count = {row_count}");
Console.WriteLine($"Records count = {record_count}")
;

and it shows this:

Rows count = 4327
Records count = 4327

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions