Options

rowversion, or how to exclude a column from a mapping

Hi!

I need guidance on how to exclude a field from the data comparison.

This particular field is being used as a high water mark in the tables and it is a rowversion type (timestamp). Does the SDK automaticall exclude them on comparison, or do I have to explicitly exclude them? Does it matter if I am using them in the where clause for comparison?

A brief example would be most welcomed. I have found a sample using the tablemapping.fieldmapping.add but not for the remove.

Thanks,
RD

Comments

  • Options
    James BJames B Posts: 1,124 Silver 4
    Thanks for your post- it looks like one of the examples on our SDK page may help: see here - although I just spotted you mailed us to say you're okay now, so if you already worked it out that's great!
    Systems Software Engineer

    Redgate Software

  • Options
    Thanks for the support. I did not find a direct sample (perhaps I missed it). This was my solution in C#:

    mapping.FieldMappings.Remove(mapping.FieldMappings["FieldName"]);
  • Options
    James BJames B Posts: 1,124 Silver 4
    Yeah, that'll work - you can either code them specifically or iterate through a collection of names obtained from "somewhere"
    Systems Software Engineer

    Redgate Software

Sign In or Register to comment.