net-workx
asked on
Field Data Type To Store IP Address - MSSQL2000
I would like to know what data type to set on a field to store IP addresses so that i can run a query against it.
I have it set to nText at the minute but i obviously cannot put a query against this data type.
Regards,
Carl
I have it set to nText at the minute but i obviously cannot put a query against this data type.
Regards,
Carl
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Why not varchar (or nvarchar)? (IP Address will only be a max of 15 characters)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
If you are storing a port number as well, it could be longer ;)
5 characters for maximum port number, 1 for space (or colon).
So 21 characters if you are storing it, 15 if not.
5 characters for maximum port number, 1 for space (or colon).
So 21 characters if you are storing it, 15 if not.