欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  数据库

限制网站频繁访问

程序员文章站 2022-06-04 18:14:07
...
CREATE TABLE [dbo].[Zz_AccessIP](
    [IP] [nvarchar](50) NOT NULL,
    [FirstDateTime] [datetime] NOT NULL,
    [LastDateTime] [datetime] NOT NULL,
    [Times] [int] NOT NULL,
 CONSTRAINT [PK_Zz_AccessIP] PRIMARY KEY CLUSTERED 
(
    [IP] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
 
GO
 
ALTER TABLE [dbo].[Zz_AccessIP] ADD  CONSTRAINT [DF_Zz_AccessIP_FirstDateTime]  DEFAULT (getdate()) FOR [FirstDateTime]
GO
 
ALTER TABLE [dbo].[Zz_AccessIP] ADD  CONSTRAINT [DF_Zz_AccessIP_LastDateTime]  DEFAULT (getdate()) FOR [LastDateTime]
GO
 
ALTER TABLE [dbo].[Zz_AccessIP] ADD  CONSTRAINT [DF_Zz_AccessIP_Times]  DEFAULT ((0)) FOR [Times]
GO