Tables [dbo].[ReportSchedule]
Properties
PropertyValue
HeapYes
Row Count0
Created12:33:31 PM Tuesday, March 06, 2007
Last Modified12:33:31 PM Tuesday, March 06, 2007
Columns
NameData TypeMax Length (Bytes)Allow Nulls
Foreign Keys FK_ReportSchedule_Schedule: [dbo].[Schedule].ScheduleIDIndexes IX_ReportSchedule_ScheduleID: ScheduleIDScheduleIDuniqueidentifier16
No
Foreign Keys FK_ReportSchedule_Report: [dbo].[Catalog].ReportIDIndexes IX_ReportSchedule_ReportID: ReportIDReportIDuniqueidentifier16
No
Foreign Keys FK_ReportSchedule_Subscriptions: [dbo].[Subscriptions].SubscriptionIDIndexes IX_ReportSchedule_SubscriptionID: SubscriptionIDSubscriptionIDuniqueidentifier16
Yes
ReportActionint4
No
Indexes Indexes
NameColumns
IX_ReportSchedule_ReportIDReportID
IX_ReportSchedule_ScheduleIDScheduleID
IX_ReportSchedule_SubscriptionIDSubscriptionID
Triggers Triggers
NameANSI Nulls OnQuoted Identifier OnOn
ReportSchedule_Schedule
Yes
Yes
After Delete
Foreign Keys Foreign Keys
NameNo CheckReplicationDeleteColumns
FK_ReportSchedule_ReportCascadeReportID->[dbo].[Catalog].[ItemID]
FK_ReportSchedule_ScheduleCascadeScheduleID->[dbo].[Schedule].[ScheduleID]
FK_ReportSchedule_Subscriptions
Yes
No
SubscriptionID->[dbo].[Subscriptions].[SubscriptionID]
Permissions
TypeActionOwning Principal
GrantDeleteRSExecRole
GrantInsertRSExecRole
GrantReferencesRSExecRole
GrantSelectRSExecRole
GrantUpdateRSExecRole
SQL Script
CREATE TABLE [dbo].[ReportSchedule]
(
[ScheduleID] [uniqueidentifier] NOT NULL,
[ReportID] [uniqueidentifier] NOT NULL,
[SubscriptionID] [uniqueidentifier] NULL,
[ReportAction] [int] NOT NULL
) ON [PRIMARY]
GO
CREATE TRIGGER [dbo].[ReportSchedule_Schedule] ON [dbo].[ReportSchedule]
AFTER DELETE
AS
delete [Schedule] from
[Schedule] S inner join deleted D on S.[ScheduleID] = D.[ScheduleID]
where
S.[Type] != 0 and
not exists (select * from [ReportSchedule] R where S.[ScheduleID] = R.[ScheduleID])

GO
CREATE NONCLUSTERED INDEX [IX_ReportSchedule_ReportID] ON [dbo].[ReportSchedule] ([ReportID]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_ReportSchedule_ScheduleID] ON [dbo].[ReportSchedule] ([ScheduleID]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_ReportSchedule_SubscriptionID] ON [dbo].[ReportSchedule] ([SubscriptionID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ReportSchedule] ADD CONSTRAINT [FK_ReportSchedule_Report] FOREIGN KEY ([ReportID]) REFERENCES [dbo].[Catalog] ([ItemID]) ON DELETE CASCADE
GO
ALTER TABLE [dbo].[ReportSchedule] ADD CONSTRAINT [FK_ReportSchedule_Schedule] FOREIGN KEY ([ScheduleID]) REFERENCES [dbo].[Schedule] ([ScheduleID]) ON DELETE CASCADE
GO
ALTER TABLE [dbo].[ReportSchedule] WITH NOCHECK ADD CONSTRAINT [FK_ReportSchedule_Subscriptions] FOREIGN KEY ([SubscriptionID]) REFERENCES [dbo].[Subscriptions] ([SubscriptionID]) NOT FOR REPLICATION
GO
ALTER TABLE [dbo].[ReportSchedule] NOCHECK CONSTRAINT [FK_ReportSchedule_Subscriptions]
GO
GRANT REFERENCES ON  [dbo].[ReportSchedule] TO [RSExecRole]
GRANT SELECT ON  [dbo].[ReportSchedule] TO [RSExecRole]
GRANT INSERT ON  [dbo].[ReportSchedule] TO [RSExecRole]
GRANT DELETE ON  [dbo].[ReportSchedule] TO [RSExecRole]
GRANT UPDATE ON  [dbo].[ReportSchedule] TO [RSExecRole]
GO
Uses
Used By