CREATE TABLE [dbo].[DayNote]
(
[DayNoteID] [int] NOT NULL IDENTITY(1, 1),
[BranchFID] [int] NOT NULL,
[NoteDate] [datetime] NOT NULL,
[NoteMemo] [text] COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
ALTER TABLE [dbo].[DayNote] ADD CONSTRAINT [PK_DayNote] PRIMARY KEY CLUSTERED ([DayNoteID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[DayNote] ADD CONSTRAINT [IX_Unique_BranchFID_NoteDate] UNIQUE NONCLUSTERED ([BranchFID], [NoteDate]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[DayNote] ADD CONSTRAINT [FK_DayNote_Branch] FOREIGN KEY ([BranchFID]) REFERENCES [dbo].[Branch] ([BranchPriKey])
GO
GRANT SELECT ON [dbo].[DayNote] TO [MssExec]
GRANT INSERT ON [dbo].[DayNote] TO [MssExec]
GRANT DELETE ON [dbo].[DayNote] TO [MssExec]
GRANT UPDATE ON [dbo].[DayNote] TO [MssExec]
GO