Possible Duplic开发者_Go百科ate:
CAST and IsNumeric
I have a database column that is nvarchar, but i want to only get the rows of the database that have integers in that column field is it possible?
Adding the '.0e0' to the end of the column in the ISNUMERIC check will ensure that only integers will be found.
SELECT *
FROM YourTable
WHERE ISNUMERIC(YourColumn + '.0e0') = 1
You check for isnumeric:
select evalcolumn from table where isnumeric(evalcolumn) = 1
精彩评论