CREATE TABLE [dbo].[Profiles]
(
[ProfileID] [int] NOT NULL IDENTITY(1, 1),
[ProfileName] [varchar] (25) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[ContactName] [varchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Memo] [varchar] (60) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[AcctPriKey] [int] NOT NULL,
[SecModulesFID] [int] NOT NULL,
[Inactive] [bit] NOT NULL CONSTRAINT [DF_Tasks_Inactive] DEFAULT ((0))
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Profiles] ADD CONSTRAINT [PK_PROFILES] PRIMARY KEY CLUSTERED ([ProfileID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_Profiles_SecModules] ON [dbo].[Profiles] ([SecModulesFID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Profiles] ADD CONSTRAINT [FK_PROFILES_ACCOUNTS] FOREIGN KEY ([AcctPriKey]) REFERENCES [dbo].[Accounts] ([AccountPriKey])
GO
ALTER TABLE [dbo].[Profiles] ADD CONSTRAINT [FK_Profiles_SecModules] FOREIGN KEY ([SecModulesFID]) REFERENCES [dbo].[SecModules] ([ModulePriKey])
GO
GRANT SELECT ON [dbo].[Profiles] TO [MssExec]
GRANT INSERT ON [dbo].[Profiles] TO [MssExec]
GRANT DELETE ON [dbo].[Profiles] TO [MssExec]
GRANT UPDATE ON [dbo].[Profiles] TO [MssExec]
GO