Selasa, 15 Februari 2011

SQL Server: Store and Retrieve IP Address

We can store IP addresses in SQL Server in a varchar column. However to retrieve IP address for a specific range, we need to split each part and compare it.Consider the following table: Suppose we want to retrieve all the IP addresses that fall in the range from 192.168.120.120 to 192.168.200.255. The following query will retrieve these IP addresses: Here’s the same query for you to try out:

Tidak ada komentar:

Posting Komentar