访问统计(浏览过的页面)[数据库设计]

if exists (select 1
   from sys.sysreferences r join sys.sysobjects o on (o.id = r.constid and o.type = 'F')
   where r.fkeyid = object_id('web_WebStatistics') and o.name = 'FK_WEB_WEBS_REFERENCE_WEB_ALLI')
alter table web_WebStatistics
   drop constraint FK_WEB_WEBS_REFERENCE_WEB_ALLI
go

if exists (select 1
            from  sysobjects
           where  id = object_id('web_AllianceCompany')
            and   type = 'U')
   drop table web_AllianceCompany
go

if exists (select 1
            from  sysobjects
           where  id = object_id('web_WebStatistics')
            and   type = 'U')
   drop table web_WebStatistics
go

/*==============================================================*/
/* Table: web_AllianceCompany                                   */
/*==============================================================*/
create table web_AllianceCompany (
   ACid                 int                  identity,
   ACname               varchar(50)          not null,
   ACinfo               varchar(500)         null,
   ACwebsite            varchar(100)         not null,
   BankAccount          varchar(100)         not null,
   DeleteStates         int                  not null default 0,
   Ctime                datetime             not null default getdate(),
   constraint PK_WEB_ALLIANCECOMPANY primary key (ACid)
)
go

declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
   '0正常1删除2回收站',
   'user', @CurrentUser, 'table', 'web_AllianceCompany', 'column', 'DeleteStates'
go

/*==============================================================*/
/* Table: web_WebStatistics                                     */
/*==============================================================*/
create table web_WebStatistics (
   WSid                 int                  identity,
   ACid                 int                  null,
   IsOrders             bigint               null default 0,
   IPAddr               varchar(50)          null,
   Vctime               datetime             null,
   Vetime               datetime             null,
   VAddr                text                 null,
   constraint PK_WEB_WEBSTATISTICS primary key (WSid)
)
go

declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
   '0否1是',
   'user', @CurrentUser, 'table', 'web_WebStatistics', 'column', 'IsOrders'
go

alter table web_WebStatistics
   add constraint FK_WEB_WEBS_REFERENCE_WEB_ALLI foreign key (ACid)
      references web_AllianceCompany (ACid)
go

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值