#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2003
    Posts
    377
    Rep Power
    76

    Search and replace of uppercase entries


    Is there a search and update query I can run looking for a file extension that is all caps? I have some file names that got stored as "filename.PDF" and I need to find them all and change to filename.pdf"
  2. #2
  3. SQL Consultant
    Devshed Supreme Being (6500+ posts)

    Join Date
    Feb 2003
    Location
    Toronto Canada
    Posts
    27,136
    Rep Power
    4274
    Code:
    UPDATE daTable
       SET filename = CONCAT(LEFT(filename,LENGTH(filename)-4),'.pdf')
     WHERE RIGHT(filename,4) = '.PDF'
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2003
    Posts
    377
    Rep Power
    76
    Thanks that worked.

IMN logo majestic logo threadwatch logo seochat tools logo