I'm sure you can search for functions people have written to do this, but here are some ways to convert your IP Address into something usable for a range comparison:DECLARE @IPAddress VARCHAR(15)SET @IPAddress = '192.169.1.1'-- Parse octetsSELECT PARSENAME(@IPAddress, 4), PARSENAME(@IPAddress, 3), PARSENAME(@IPAddress, 2), PARSENAME(@IPAddress, 1)--Convert to numberSELECT CAST(PARSENAME(@IPAddress, 4) AS BIGINT) * POWER(256, 3) + CAST(PARSENAME(@IPAddress, 3) AS BIGINT) * POWER(256, 2) + CAST(PARSENAME(@IPAddress, 2) AS BIGINT) * POWER(256, 1) + CAST(PARSENAME(@IPAddress, 1) AS BIGINT) * POWER(256, 0)