Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Return IP Addresses given a subnet and mask

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2006-02-17 : 08:40:45
Paul Langford writes "Hi,

Great site you have here - got lots of answers, so firstly would like to day thanks!

We have a table with subnets in the form x.x.x.x/yy where yy is the bitmask.

We are regularly given lists of IPs without any subnet information, and we need to match the ip to one of our x.x.x.x/yy subnets.

Working out the possible subnet and bitmask combinations for an ip and comparing if it's in our table is one way.
But I think the best way would be to take the x.x.x.x/yy and explode this into its possible IPs for comparison. We have a lot of subnets (1000s) in this table, and they are all class C, so we could reduce the compare-to list by looking only at the last octets or something.

Anyway - your advice would be great!

btw the parsename thingy is well cool!

Cheers,
Paul."

TG
Master Smack Fu Yak Hacker

6065 Posts

Posted - 2006-02-17 : 13:15:00
See if any solutions in this thread help:
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=58310

If not, post a sample of what you would start with and what results that should produce.

Be One with the Optimizer
TG
Go to Top of Page
   

- Advertisement -