Solved

Replace NOT CaseSensitive

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

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Insert Salary Period that has 2 months 11 25
CROSS APPLY 4 45
My Query is not giving correct result. Please help 5 32
Getting same value for every field in SQL 2 34
Audit has been really one of the more interesting, most useful, yet difficult to maintain topics in the history of SQL Server. In earlier versions of SQL people had very few options for auditing in SQL Server. It typically meant using SQL Trace …
How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

863 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

19 Experts available now in Live!

Get 1:1 Help Now