• Thanks Dwain.

    I tried

    select LEFT(127.0.0.1,len(127.0.0.1-charindex('.',reverse(([Ip]))

    from [dbo].[TestTable]

    but am getting

    Incorrect syntax near the keyword 'from'.

    127.0.0.1 is column name.

    Since I'll probably have a list of over 100k I don't think the other options would be practical.