Hi I have a stored procedure which suppose to compare between 2 columns on different tables
- Users.ID => int
- Trans.ID => nvarchar
Sometimes the value in Trans.ID is not numeric at all, and sometimes it’s null, which causes an error while trying to compare
is there a way to try to parse Trans.ID into a number and in case it doesn’t succeed to return 0??
I tried NullIf() but it doesn’t work when the value inside is not numeric.
you can do something like:
hope this helps.