Just had an odd error. I have a function that has 2 variables declared as SQL Variants, being @CCY1 and @CCY2. In the code I simply say something like this...
IF @CCY1=@CCY2
BEGIN
SELECT @fx_rate=1
RETURN @fx_rate
END
On my laptop copy of production if @CCY1 is equal to 'AUD' and @CCY2 is also equal to 'AUD' the code in the BEGIN/END executes. However on the production environment, that does not hold and @CCY1 <> @CCY2.
It is an easy fix by casting to a VARCHAR in this instance. My question is why would the behaviour be different on the two different environments (Both as SQL Server 2016)?