Needing help in an SQL script, I have a field name RESULT with a data type varchar, I would like to check how to get the integer value and convert to int to link to another table as relationship?

image

TRY_CONVERT(int, RESULT)

This will return an int value if it can, otherwise it returns NULL.
What it will NOT do is find ints inside strings, such as abc123def.

Thank you very much, this is very helpful. :wink:

This would be fine for small tables. As the table grows you will have performance issues when converting the columns.
It is good to have the columns with same datatypes used in joins.