Solved

Replace NOT CaseSensitive

Posted on 2010-09-13
4
360 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 500 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

What Is Transaction Monitoring and who needs it?

Synthetic Transaction Monitoring that you need for the day to day, which ensures your business website keeps running optimally, and that there is no downtime to impact your customer experience.

Question has a verified solution.

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

There have been several questions about Large Transaction Log Files in SQL Server 2008, and how to get rid of them when disk space has become critical. This article will explain how to disable full recovery and implement simple recovery that carries…
In this article I will describe the Detach & Attach method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

688 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