SQL server converts the IP address saved in integer to the normal IP format of dot Division

From , 4 Years ago, written in SQL, viewed 51 times.
URL https://pastebin.vip/view/77ef24b4
  1. SELECT dbo.IPADDRESS.IPADDRESS,
  2. CAST(ROUND( (CAST(CAST(dbo.IPADDRESS.IPADDRESS AS BINARY(4)) AS BIGINT) / 16777216 ), 0, 1) AS VARCHAR(4)) + '.' +
  3. CAST((ROUND( (CAST(CAST(dbo.IPADDRESS.IPADDRESS AS BINARY(4)) AS BIGINT) / 65536 ), 0, 1) % 256) AS VARCHAR(4)) + '.' +
  4. CAST((ROUND( (CAST(CAST(dbo.IPADDRESS.IPADDRESS AS BINARY(4)) AS BIGINT) / 256 ), 0, 1) % 256) AS VARCHAR(4)) + '.' +
  5. CAST((CAST(CAST(dbo.IPADDRESS.IPADDRESS AS BINARY(4)) AS BIGINT) % 256 ) AS VARCHAR(4)) AS IPDottedNotation
  6. //SQL/8735

Reply to "SQL server converts the IP address saved in integer to the normal IP format of dot Division"

Here you can reply to the paste above

captcha

https://burned.cc - Burn After Reading Website