开发者

Getting around the lack of IsNumeric() function in SQL CE?

SQL Server 开发者_StackOverflow社区CE (3.5) doesn't appear to support the IsNumeric function. What are some alternatives to achieve the same functionality? Specifically, how would you test whether a CAST from a string to a DECIMAL datatype will succeed in SQLCE without IsNumeric?


One possibility is to explicitly add an ISNUMERIC column to the table, and set the value (in your code, using your own method or a built-in .NET method) whenever the row is added or updated.

Another possibility is to use a query like this:

SELECT * FROM tbl WHERE col LIKE '%[^0-9]%'
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜