How can I use ISNUMERIC() function with sql_variant datatype?
This following code doesn't work
DECLARE @x sql_variant
SET @x = 3
IF ISNUMERIC(@x) = 1
SELECT 'Numeric'
ELSE
SELECT ' NOT'
Error :
Msg 8116, Level 16, State 1, Line 4
Argument data type sql_variant is invalid for argument 1 of isnumeric function.
But this works
IF ISNUMERIC(CAST(@x AS INT)) = 1
is there is any way of making this happened with out CAST()
Haven't found any thing useful on google regarding this issue thanks , I'm using SQL Server 2008 R2
NVARCHAR'3' be deemed numeric?