7
Answers

Covert text to int mssql

Goran Bibic

Goran Bibic

2y
643
1

Hello, need to replace NULL values with text (letter A or ... or N/A)
Example If is null to write ...

Error is

Conversion failed when converting the varchar value 'A1' to data type int.

 

SELECT (CASE WHEN prazno2 IS NULL THEN CONCAT('A',id) ELSE prazno2 END) as Rb FROM DBO.cte

 

Answers (7)