title: How to store both IPv4 or IPv6 in single column in SQL Server?
body: <p>Should I use <code>binary(16)</code> or <code>varbinary(16)</code>?</p>
  
  <p>I know I can use  <code>getAddress()</code> in <code>java.net.InetAddress</code> (Java) or <code>System.Net.IPAddress</code> (C#) to get a <code>byte[]</code> representation of both <code>IPv4</code> and <code>IPv6</code>, but if I need to insert <code>IPv4</code> i.e. <code>binary(4)</code> into a <code>binary(16)</code> field in <code>SQL Server</code>, do I need to worry about padding or anything?</p>