• I've couldn't run OP code in SQL2008 as he is using 2012 function.

    Now, I can see what is result of his query.

    The following will produce the same:

    select *

    ,ISNULL(TRY_CONVERT(INT,SUBSTRING(x,NULLIF(PATINDEX('%-[0-9]%',x),0) + 1,LEN(x)) ),-1)

    from tmp

    Looks like 123.4 is not an integer, so -1 should be returned.

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]