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.
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.