Solved

Replace NOT CaseSensitive

Posted on 2010-09-13
4
355 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
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 142

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Long way back, we had to take help from third party tools in order to encrypt and decrypt data.  Gradually Microsoft understood the need for this feature and started to implement it by building functionality into SQL Server. Finally, with SQL 2008, …
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…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

825 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