sql server - ISNULL, COALESCE functions -



sql server - ISNULL, COALESCE functions -

how utilize isnull int values, varchar values

select complaint.complaintprofileid,isnull(t2.mmb_id,'notfound') mmbid complaints c bring together t2.. on t2.sno = c.sno

this query gives me error

conversion failed when converting varchar value 'notfound' info type int. mmb_id int

thanks sun

try converting int column varchar,

select complaint.complaintprofileid, isnull(convert(varchar(11), t2.mmb_id), 'notfound') mmbid complaints c bring together t2.. on t2.sno = c.no

sql-server

Comments

Popular posts from this blog

c# - Move local mssql database to webhosted MYSQL -

java - How to pass parameters between Request-Scoped Controllers? -

string - what is the difference between "some" == "some\0" and strcmp("some","some\0") in c++? -