How to ignore leading spaces
vlady
Posts: 3
I'm trying to compare tables in different databases. Table in one database has CHAR datatype columns with leading spaces and table in another database has VARCHAR datatype column with leading spaced trimmed before input.
Is it possible to compare these tables while ignoring leading spaces?
If not I was planning to copy tables to same source and manually trim spaces before comparing. Is there better way?
Is it possible to compare these tables while ignoring leading spaces?
If not I was planning to copy tables to same source and manually trim spaces before comparing. Is there better way?
Comments
Unfortunately it is not possible to ignore the leading whitespace in a string.
There is an option to ignore trailing white space however this will only ignore spaces at the end of the string.
If you wish you can request the feature to ignore leading whitespace in our uservoice forum.
http://redgate.uservoice.com/forums/147 ... ta-compare
These forums are actively monitored by our development team and allow our users to request features and vote on them.
If a feature receives a significant amount of votes or is deemed to have merit development may include the feature in a future release.
If not I was planning to copy tables to same source and manually trim spaces before comparing. Is there better way?
Alternatively you could create a view and use the view in the comparison. Provided you enable the option to "Include views". Then map the view to the table in object mapping.
http://documentation.red-gate.com/displ ... ct+options
Manfred
Product Support
Red Gate Software
Product Manager
Redgate Software