I am creating database for a website and want to store IP Address of user when they are login, what data type should I be using for IP? does it need to support IPv6?
Is this script good and does it need to pars IP?
CREATE TABLE [dbo].[temp](
[id] [bigint] IDENTITY(1,1) NOT NULL,
[userId] [bigint] NOT NULL,
[ip] [varchar](40) NOT NULL,
[dateTime] [datetime] NOT NULL,
CONSTRAINT [PK_temp] PRIMARY KEY CLUSTERED
(
[id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]