Data type conversion

bryantb2bryantb2 Posts: 3
I have manually mapped 2 databases as follows:
tableMapping.FieldMappings.Add(new FieldMapping(tableMapping.Obj1.Fields["pa_firstname"], tableMapping.Obj2.Fields["FirstName"], FieldMappingStatus.Success));
tableMapping.FieldMappings.Add(new FieldMapping(tableMapping.Obj1.Fields["pa_lastname"], tableMapping.Obj2.Fields["LastName"], FieldMappingStatus.Success));
tableMapping.MatchingMappings.Add(new FieldMapping(tableMapping.Obj1.Fields["pa_id"], tableMapping.Obj2.Fields["SurrogateKey"], FieldMappingStatus.Success));
My problem is that when I call CompareDatabases I receive the following error:
RedGate.SQLCompare.Engine.SqlCompareException was unhandled
Message=Unable to compare between fields pa_id and SurrogateKey, types being compared System.Int64 and System.String.
Source=RedGate.SQLDataCompare.Engine

Is it possible to compare a field, in this case "pa_id", as a varchar type rather than its native type?

Comments

Sign In or Register to comment.