I have a T-Sql statement that is getting the next available number from a table. but the column is of type nvarchar. It dost have to be a number, But i still need to be able to get the next available number
so when i run the sql i try to only get numbers
WHERE
ISNUMERIC(myCol) AND CAST(REPLACE(myCol, N'0', N'') AS int)
but i get error
Conversion failed when converting the nvarchar value '45D-1' to data type int.
So i ran just
select ISNUMERIC('45D-1')
And to my surprise its true
I already wrote a replace for "." which makes sense, But why is "D" a number? And why cant sql cast it? And is there a function to really test if its a Int?