Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Database > SQL Language
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
SQL Language SQL Language discussions not specific to a particular RDBMS program or vendor.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Language section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 28th, 2008, 09:45 PM
Authorized User
 
Join Date: May 2008
Location: , , .
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default column uniqueness that trim's trailing whitespace?

I currently have a table with 3 columns required for uniqueness, using the following:
    UNIQUE KEY `transDate_desc_amount` (`transaction_date`,`description`,`amount`)

The issue I am finding is that some of the "description" column data has snuck into the database with trailing white space. Hence I'm wondering whether a good way to avoid duplicates being created is to have the constraint know about ignoring white space?

Do you know if this is possible?

e.g. something like UNIQUE KEY `transDate_desc_amount` (`transaction_date`,TRIM(`description`),`amount`)

Thanks
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I keep leading and trailing whitespaces? 2BOrNot2B XSLT 2 October 31st, 2008 11:35 AM
Uniqueness of LoginStatus controls roman BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 4 June 25th, 2008 05:01 PM
SQL - removing trailing zeros skywalker1981 SQL Server 2000 4 April 1st, 2008 08:32 AM
Remove Leading and Trailing Zeros lene_wee SQL Server 2000 3 April 1st, 2008 08:23 AM
Remove the trailing whitespace ksskumar XSLT 1 October 13th, 2006 06:23 AM



All times are GMT -4. The time now is 09:18 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.