Red Gate forums :: View topic - How to ignore leading spaces
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Data Compare 10
SQL Data Compare 10 forum

How to ignore leading spaces

Search in SQL Data Compare 10 forum
Post new topic   Reply to topic
Jump to:  
Author Message
vlady



Joined: 01 May 2014
Posts: 2

PostPosted: Thu May 01, 2014 3:41 pm    Post subject: How to ignore leading spaces Reply with quote

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?
Back to top
View user's profile Send private message
Manfred.Castro



Joined: 23 Apr 2012
Posts: 209

PostPosted: Thu May 01, 2014 5:38 pm    Post subject: Reply with quote

Is it possible to compare these tables while ignoring leading spaces?

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/147879-sql-data-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/display/SDC10/Setting+project+options

Manfred
_________________
Manfred Castro
Product Support
Red Gate Software
Back to top
View user's profile Send private message
David Atkinson



Joined: 05 Dec 2005
Posts: 1121
Location: Twitter: @dtabase

PostPosted: Thu May 01, 2014 10:51 pm    Post subject: Reply with quote

Are you able to create a view? If you do this and LTRIM the column in question, you can map the view against the table in the second database in order to run your comparison. Make sure "include views" is enabled in SQL Data Compare mapping behavior options.
Back to top
View user's profile Send private message Send e-mail
vlady



Joined: 01 May 2014
Posts: 2

PostPosted: Tue May 13, 2014 12:52 pm    Post subject: Reply with quote

Thanks I was able to compare by creating view that included LTRIM()
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group