IPv4 subnetting in SQL Server

  • I am relatively new to SQL server so I'd really appreciate any help I can get.

    I'm developing a database that contains networking equipment and their assigned IP addresses. It also needs to contain the range of IP addresses available. For instance, suppose I have a subnet ID of 10.10.10.0 with a subnet mask of 255.255.255.0, I would like to have a field (we'll name it hostRange) which contains the range of IP addresses available for that subnet given the IP address and the subnet mask. In our case, hostRange would be 10.10.10.1-10.10.10.254.

    I am building an application in visual studio to interface with this database so the work could either be done in sql server, or in visual studio. I'm currently storing the IP address as binary. At least that is the data type I'm using. I have yet to figure out how to convert from text to binary and from binary to text. Also I would prefer if the user would see 10.10.10.0/24 instead of two separate fields; one for IP address an done for subnet mask.

  • you can use the programming code to do it and save the data inside the sql server in your convenient data form

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply