Solved

Replace NOT CaseSensitive

Posted on 2010-09-13
4
348 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
  • 2
4 Comments
 
LVL 60

Expert Comment

by:chapmandew
Comment Utility
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 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
Comment Utility
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
Comment Utility
forgot the collate part:

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

Author Closing Comment

by:Delphiwizard
Comment Utility
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

Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

Join & Write a Comment

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 we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

743 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now