I have following function on SQL Server and LocalDB:
CREATE FUNCTION [dbo].[ConvertToLong]
(
@Value Varchar(200)
)
RETURNS Bigint
AS
BEGIN
If ISNUMERIC(@Value)<>1
Return 0
Else
Return Cast(@Value as bigint)
Return 0
END
when calling this function like this:
SELECT dbo.[ConvertToLong]('13668433347')
I receive different results:
SQLServer:
13668433347
LocalDB:
Arithmetic overflow error converting expression to data type int.
Any ideas what is the problem and how to fix it for LocalDB?