Goran Bibic

Goran Bibic

  • 732
  • 2.6k
  • 120.5k

Covert text to int mssql

Jul 16 2022 8:56 PM

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)