IP Subnet Test

  • Thread starter Thread starter Niclas
  • Start date Start date
N

Niclas

Hi,

Does anyone have some code that would allow me to test if a specific IP
address is within a specific IP range or a distinct subnet or similar ?

Any help appreciated.

Thanks

Niclas
 
you can use the parsename function in sql server to do this.

parsename(@myIP, 3) = '192' AND parsename(@myIP, 2) = '168'

etc
 
Back
Top