So you have done some conversion from some numeric datatype to Varchar(30). The warning is for that. In most cases I have seen this message benign and can be ignored. It is more of informative message. I cant read much though you have hidden lot of things.
Execution plan -warnining with coverstion
Hi My sql has an issue with execution plan warning SQL conversion when I use cast(VALUE1 as varchar(30)) or CONVERT(char,VALUE1). Both way I am getting the warning
table column is numaric (21,4)
any one can help would be highly appreciated .
many thanks
3 answers
Sort by: Most helpful
-
-
Olaf Helper 46,201 Reputation points
2020-12-01T07:19:17.583+00:00 Have you used the conversion in the WHERE clause or JOIN condition? That prevents the usage of an existing index and that causes performance issues; that's why you get a warning.
-
Ashwan 531 Reputation points
2020-12-03T04:51:00.447+00:00 Hi Ola Thank you for the responce. yes there is where clause and join . Thouse use to join/where clause with dffirent column .
cmVALUE- is numaric
cmVal1 - is characterselect T1.NO no, DESC name,
case
when convert(varchar(max),cmVALUE) = '' then convert(varchar(max),cmVALUE)
when cmVALUE= 0 then convert(varchar(max),ATVALUE)
else convert(varchar(max),cmVALUE)
end cmVal1
from echema.tab1
where class = 'XV'
and PNO is not null