SET QUOTED_IDENTIFIER OFF
GO
CREATE FUNCTION [dbo].[float8](@input sql_variant )
RETURNS float(53) AS
BEGIN
DECLARE @type nvarchar(30)
SET @type = CONVERT(nvarchar(30), SQL_VARIANT_PROPERTY(@input, 'BaseType'))
IF( (@type = 'varbinary') OR (@type = 'binary') OR
(@type = 'timestamp') OR (@type = 'uniqueidentifier') OR
(@type = 'image') OR (@type = 'ntext') OR (@type = 'text'))
RETURN 0
RETURN CONVERT(float(53), @input)
END
GO