What is the SQL Server equivalent of INET_ATON

前端 未结 3 1868
渐次进展
渐次进展 2021-02-10 06:18

As the question says what is the SQL Server equivalent of INET_ATON from mySql. The reason I need this is because i imported a IP data base from http://ipinfodb.com

3条回答
  •  南方客
    南方客 (楼主)
    2021-02-10 06:51

    There is no built in function to do this in MSSQL, however the formula for converting A.B.C.D to an IP Number is:

    IP Number = A x (256*256*256) + B x (256*256) + C x 256 + D

    I may have the sql functions written somewhere to do this, ill have a look.

提交回复
热议问题