Goran Bibic

Goran Bibic

  • 482
  • 2.9k
  • 197.2k

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)