T-sql - determine if value is integer
问题 I want to determine if a value is integer (like TryParse in .NET). Unfortunatelly ISNUMERIC does not fit me because I want to parse only integers and not every kind of number. Is there such thing as ISINT or something? Here is some code to make things clear. If MY_FIELD is not int, this code would fail: SELECT @MY_VAR = CAST(MY_FIELD AS INT) FROM MY_TABLE WHERE MY_OTHER_FIELD = 'MY_FILTER' Thank you 回答1: Here's a blog post describing the creation of an IsInteger UDF. Basically, it recommends