Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Replace NOT CaseSensitive

Posted on 2010-09-13
4
Medium Priority
?
365 Views
Last Modified: 2012-05-10
Hi,

Following code I use the replace a string is a field.

UPDATE Communication SET Documentname  = REPLACE(Documentname, @vBasisMapDocumenten, '')

How can I make this Case Insensitive?
0
Comment
Question by:Delphiwizard
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 60

Expert Comment

by:chapmandew
ID: 33662133
I assume it is not finding the value, right?  

could try this:

UPDATE Communication SET Documentname  = REPLACE(Documentname, @vBasisMapDocumenten, '') SQL_Latin1_General_CP1_CI_AS
0
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 2000 total points
ID: 33662150
can you clarify?
I presume that you want to search for the value of @vBasisMapDocumenten in a case insensitive manner.
this would be implicitly the case when the column DocumentName has a case insensitive collation, resp the database's default collation also.
to "force", use COLLATE:
http://msdn.microsoft.com/en-us/library/ms184391.aspx
specify a collation that is close to what you have in the column's data type, but insensitive...
UPDATE Communication 
  SET Documentname  = REPLACE(Documentname COLLACTE <collation name here>, @vBasisMapDocumenten COLLATE <collation name here>, '')

Open in new window

0
 
LVL 60

Expert Comment

by:chapmandew
ID: 33662158
forgot the collate part:

UPDATE Communication SET Documentname  = REPLACE(Documentname, @vBasisMapDocumenten, '') COLLATE SQL_Latin1_General_CP1_CI_AS
0
 

Author Closing Comment

by:Delphiwizard
ID: 33669257
Thank you all.
Apparently the default for all created databases is Latin1_General_CI_AS which is case insensitive.
My filed had this set to the .
The additional info from the website was very helpfull.
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Naughty Me. While I was changing the database name from DB1 to DB_PROD1 (yep it's not real database name ^v^), I changed the database name and notified my application fellows that I did it. They turn on the application, and everything is working. A …
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question