Posts Tagged ‘inet_ntoa’

MS SQL numeric to ip

Thursday, June 5th, 2008

I love the fact that I know SQL and can go against the database directly instead of having to accept someone elses preconceived ideas of what kind of data I need.

I needed to find out all hits in a database from a specific range of IP addresses range. the table stores the IP’s in a numeric form which is a no brainer on mysql you just use inet_ntoa and inet_atoa to convert back and forward, but Microsoft SQL Server (mssql) doesn’t support that so a little googling later I came up with this page, which has some stored procedures for doing the convertion, now I am just waiting for the database to come back with the data. SWEET