[dbo].[CustomerNoteDetail]
CREATE TABLE [dbo].[CustomerNoteDetail]
(
[CustomerNoteDetailID] [int] NOT NULL IDENTITY(1, 1),
[CustomerNoteHeaderFID] [int] NOT NULL,
[CreatedDate] [datetime] NOT NULL,
[CreatedByFID] [int] NOT NULL,
[NoteBody] [text] COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[PublicFlag] [bit] NOT NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
ALTER TABLE [dbo].[CustomerNoteDetail] ADD CONSTRAINT [PK_CustomerNoteDetail] PRIMARY KEY CLUSTERED ([CustomerNoteDetailID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_CustomerNoteDetail_CreatedByFID] ON [dbo].[CustomerNoteDetail] ([CreatedByFID]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_CustomerNoteDetail_CustomerNoteHeaderFID] ON [dbo].[CustomerNoteDetail] ([CustomerNoteHeaderFID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[CustomerNoteDetail] ADD CONSTRAINT [FK_CustomerNoteDetail_Sysuser] FOREIGN KEY ([CreatedByFID]) REFERENCES [dbo].[Sysuser] ([SysUserID])
GO
ALTER TABLE [dbo].[CustomerNoteDetail] ADD CONSTRAINT [FK_CustomerNoteDetail_CustomerNoteHeader] FOREIGN KEY ([CustomerNoteHeaderFID]) REFERENCES [dbo].[CustomerNoteHeader] ([CustomerNoteHeaderID])
GO
GRANT SELECT ON [dbo].[CustomerNoteDetail] TO [MssExec]
GRANT INSERT ON [dbo].[CustomerNoteDetail] TO [MssExec]
GRANT DELETE ON [dbo].[CustomerNoteDetail] TO [MssExec]
GRANT UPDATE ON [dbo].[CustomerNoteDetail] TO [MssExec]
GO