I am trying this
UPDATE table
SET col = CONVERT(int, col)
and i am getting
Msg 245, Level 16, State 1, Line 2 Conversion failed when converting the varchar value '106/1' to data type int.
I am trying this
UPDATE table
SET col = CONVERT(int, col)
and i am getting
Msg 245, Level 16, State 1, Line 2 Conversion failed when converting the varchar value '106/1' to data type int.
If 2012+, you can use TRY_CONVERT() ... invalid would return NULL
UPDATE table SET col = TRY_CONVERT(int, col)
If not 2012+
UPDATE table SET col = case when isnumeric(col+'.01')=0 then null else CONVERT(int,col) end
Edit (learned that isnumeric() trick last night by Shnugo)
Check the type of argument you are passing into the method , your method asks for an argument of Type Int but you are giving it as a varchar that's why its throwing exception. Try with giving an int once