• Stephane

    Your syntax doesn't look quite right.  I don't see how your update statement can work.  How about this (not tested, obviously):

    update r

    set countryId = c.countryId

    from #regions r join tbl_ip2countries c

    on r.ipFloat = c.ipFloat

    where r.ipFloat between c.ipFrom and c.ipTo

    John