Missing Field from Where Clause
jimmypooh
Posts: 12
I'm using the compaire and passing it a where clause for each mapping. However, not all tabled have the field I'm using in the where clause. Is there a way to tell the comparer to ignore the where clause if it errors?
Or I guess the better question is how do I check the TableMapping if that particular where clause will be viable (ie if a certain field exists).
Or I guess the better question is how do I check the TableMapping if that particular where clause will be viable (ie if a certain field exists).
Comments
There isn't a particularly quick way of doing this, but one option is as below:
In this instance, as I iterate around the mappings collection I'm checking for a certain table name. Within that check, I'm going through the fields collection to then see if a specific column exists.
You can perhaps tweak this so the column or table level check looks at your where clause to automate it to a certain extent.
Hope that helps.
Redgate Software