CREATE TABLE [dbo].[WebAccess]
(
[PriKey] [int] NOT NULL IDENTITY(1, 1),
[ProfileID] [int] NULL,
[Hits] [int] NULL,
[UserType] [int] NULL,
[CompanyName] [varchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[SysuserPriKey] [int] NULL,
[UserID] [varchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[Password] [varbinary] (max) NOT NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
ALTER TABLE [dbo].[WebAccess] ADD CONSTRAINT [PK_WebAccess] PRIMARY KEY CLUSTERED ([PriKey]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[WebAccess] ADD CONSTRAINT [IX_WebAccess_UserID] UNIQUE NONCLUSTERED ([UserID]) ON [PRIMARY]
GO
CREATE UNIQUE NONCLUSTERED INDEX [IX_WebAccess_SysuserPriKey] ON [dbo].[WebAccess] ([SysuserPriKey]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[WebAccess] ADD CONSTRAINT [fk_WebAccess_Profiles] FOREIGN KEY ([ProfileID]) REFERENCES [dbo].[Profiles] ([ProfileID])
GO
ALTER TABLE [dbo].[WebAccess] ADD CONSTRAINT [fk_WebAccess_Sysuser] FOREIGN KEY ([SysuserPriKey]) REFERENCES [dbo].[Sysuser] ([SysUserID])
GO
ALTER TABLE [dbo].[WebAccess] ADD CONSTRAINT [fk_WebAccess_WebUserType] FOREIGN KEY ([UserType]) REFERENCES [dbo].[WebUserType] ([WebUserTypeID])
GO
GRANT SELECT ON [dbo].[WebAccess] TO [MssExec]
GRANT INSERT ON [dbo].[WebAccess] TO [MssExec]
GRANT DELETE ON [dbo].[WebAccess] TO [MssExec]
GRANT UPDATE ON [dbo].[WebAccess] TO [MssExec]
GO