Skip to content

Recommended SQL Server data type? #46

Description

@mwoffenden

What is the recommended SQL Server data type for use with this to store IP addresses?

Activity

  1. manigandham commented on Feb 12, 2019

    @manigandham

    Single addresses? IPv4 can be stored as integers (since that's what they are). Otherwise, or if you need IPv6, use binary to store the raw bytes or varchar to store as a string.

    If you need ranges then there's no easy way. Simplest would be to store the max and min values separately, and the range too as a string just in case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions