This is a migrated thread and some comments may be shown as answers.

script to add SchedulerData tables

3 Answers 73 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
drgorin
Top achievements
Rank 1
drgorin asked on 07 Jan 2008, 03:43 AM
Hello tech support,

Can the minds at telerik please provide us with a script that automatically adds the SchedulerData tables to an existing database?  For example: Northwind.  

Thank you 
Neil Gorin 

3 Answers, 1 is accepted

Sort by
0
T. Tsonev
Telerik team
answered on 07 Jan 2008, 04:00 PM
Hi,

Of course, here is the script for the basic structure (no resources):

USE [Northwind]  
GO  
 
CREATE TABLE [dbo].[Appointments]  
(  
    [ID]                    int IDENTITY(1,1)   NOT NULL,  
    [Subject]               nvarchar(255)       NOT NULL,  
    [Start]                 datetime            NOT NULL,  
    [End]                   datetime            NOT NULL,  
    [RecurrenceRule]        nvarchar(1024)      NULL,  
    [RecurrenceParentID]    int                 NULL,  
    [Annotations]           nvarchar(50)        NULL,  
 
    CONSTRAINT [PK_Appointments] PRIMARY KEY CLUSTERED   
        ([ID]),  
 
    CONSTRAINT [FK_Appointments_ParentAppointments] FOREIGN KEY  
        ([RecurrenceParentID])  
    REFERENCES  
        [dbo].[Appointments] ([ID])  
)  
GO  
 


Best wishes,
Tsvetomir Tsonev
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
drgorin
Top achievements
Rank 1
answered on 07 Jan 2008, 04:52 PM
Thank you for this abbreviated script, which builds 1 of the database tables.  We would greatly appreciate the script that builds the *entire* database solution, including all tables, PK's , FK's  resources, users, rooms, etc.   
0
T. Tsonev
Telerik team
answered on 08 Jan 2008, 08:07 AM
Hello,

Sorry, I assumed that you will not be using the resource definitions from the examples. Here is the complete script:

USE [DBName]
GO

SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [Rooms]
(
    [ID]        int                IDENTITY(1,1)   NOT NULL,
    [RoomName]  nvarchar(255)                    NOT NULL,

    CONSTRAINT [PK_Rooms] PRIMARY KEY CLUSTERED
    ([ID])
)
GO

CREATE TABLE [Users]
(
    [ID]        int                NOT NULL,
    [UserName]  nvarchar(255)      NOT NULL,
 
    CONSTRAINT [PK_Users] PRIMARY KEY CLUSTERED
    ([ID])
)
GO
 
CREATE TABLE [dbo].[Appointments] 

    [ID]                    int IDENTITY(1,1)   NOT NULL, 
    [Subject]               nvarchar(255)       NOT NULL, 
    [Start]                 datetime            NOT NULL, 
    [End]                   datetime            NOT NULL,
    [RoomID]                int                 NULL,
    [UserID]                int                 NULL,
    [RecurrenceRule]        nvarchar(1024)      NULL, 
    [RecurrenceParentID]    int                 NULL, 
    [Annotations]           nvarchar(50)        NULL, 
 
    CONSTRAINT [PK_Appointments] PRIMARY KEY CLUSTERED  
        ([ID]), 
 
    CONSTRAINT [FK_Appointments_ParentAppointments] FOREIGN KEY 
        ([RecurrenceParentID]) 
    REFERENCES 
        [Appointments] ([ID]),
 
    CONSTRAINT [FK_Appointments_Rooms] FOREIGN KEY 
        ([RoomID]) 
    REFERENCES 
        [Rooms] ([ID]),
 
    CONSTRAINT [FK_Appointments_Users] FOREIGN KEY 
        ([UserID]) 
    REFERENCES 
        [Users] ([ID]) 

GO



Greetings,
Tsvetomir Tsonev
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Scheduler
Asked by
drgorin
Top achievements
Rank 1
Answers by
T. Tsonev
Telerik team
drgorin
Top achievements
Rank 1
Share this question
or