Conversion failed when converting the varchar value 'A1' to data type int.
CONVERT(INT, CONVERT(VARCHAR(12), 'A'))
SELECT (CASE WHEN prazno2 IS NULL THEN CONCAT('A',id) ELSE prazno2 END) as Rb FROM DBO.cte
SELECT COALESCE(CAST([prazno2] AS VARCHAR(30)), 'A') AS Rb FROM DBO.cte
CAST([prazno2] AS VARCHAR(30))
SELECT COALESCE(CAST([prazno2] AS CHAR(30)), CONCAT('A', [Id])) AS Rd, [prazno2], [drawing_name]FROM [CP].[dbo].[pieces]
Rd prazno2 drawing_name 10 10 D1234 20 20 C1234 A3 NULL IdNull A4 NULL NULL
id drawing_name prazno2 1 D1234 10 2 C1234 20 3 IdNull NULL 4 NULL NULL
A
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)