- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
SELECT TOP 100 Col008, Col012,
CAST(
CASE WHEN SUBSTRING(Col008, 9, 1) IN ('å', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R')
THEN '-' ELSE '' END +
REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(
REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(
Col008, 'æ', '0'), 'A', '1'), 'B', '2'), 'C', '3'), 'D', '4'),
'E', '5'), 'F', '6'), 'G', '7'), 'H', '8'), 'I', '9'),
'å', '0'), 'J', '1'), 'K', '2'), 'L', '3'), 'M', '4'),
'N', '5'), 'O', '6'), 'P', '7'), 'Q', '8'), 'R', '9')
AS INT) AS Col008num,
CAST(
CASE WHEN SUBSTRING(Col012, 7, 1) IN ('å', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R')
THEN '-' ELSE '' END +
REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(
REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(
Col012, 'æ', '0'), 'A', '1'), 'B', '2'), 'C', '3'), 'D', '4'),
'E', '5'), 'F', '6'), 'G', '7'), 'H', '8'), 'I', '9'),
'å', '0'), 'J', '1'), 'K', '2'), 'L', '3'), 'M', '4'),
'N', '5'), 'O', '6'), 'P', '7'), 'Q', '8'), 'R', '9')
AS INT) AS Col012num
FROM dbo.Source_Table