In a database with AccentSensitive=off the Replace function treats 'a' and 'ä' the same. So does any way exists to temporarily force AccentSensitivity for the Replace function?

asked 09 Oct '15, 09:21

Martin's gravatar image

Martin
9.0k130169257
accept rate: 14%

If you are just trying to come up with a 'key' to do sorting on you might wnat to review the "sort_collation" option but it sounds like you are intent upon some sort of translation.

As far as I can tell, that would need a collation-tailoring to accomplish this and there are only the 2 [Strng] functions SORTKEY( ) and COMPARE( ) that have that support. Neither of those will accomplish this by themselves.

It seems to require custom logic. External function logic may be a better solution.

(09 Oct '15, 11:11) Nick Elson S...
Replies hidden

yes we now use a external .net function to do the trick

(12 Oct '15, 03:38) Martin

Treating the whole string as binary (and therefore case sensitivity and the like) would be too strong, I guess? Otherwise, replace() with binary datatypes might do the trick.

permanent link

answered 11 Oct '15, 07:08

Volker%20Barth's gravatar image

Volker Barth
40.1k361549819
accept rate: 34%

converted 12 Oct '15, 04:43

Martin's gravatar image

Martin
9.0k130169257

1

I think binary replace is available from SQLA 17 up

(12 Oct '15, 04:44) Martin
Replies hidden

Yes, I should have known better, as I asked that a while ago:

How do builtin string functions work with binary data?

and Mark has explained that REPLACE() (pre-v17) does only work with character data and would convert binary input into character data...

(12 Oct '15, 05:13) Volker Barth
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×17

question asked: 09 Oct '15, 09:21

question was seen: 2,168 times

last updated: 12 Oct '15, 05:13