• ZZartin - Wednesday, February 28, 2018 12:33 PM

    Another option is to use TRY_CONVERT() if you want to make sure it'll actually convert to something in SQL server 

    select 'yes'
    where TRY_CONVERT(decimal(29, 9), @SearchVal) IS NOT NULL

    Good solution and would probably be fine. Note this though: 

    SELECT TRY_CONVERT(decimal(29, 9), $)

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001