script to add SchedulerData tables

4 posts, 0 answers
  1. drgorin
    drgorin avatar
    10 posts
    Member since:
    Aug 2012

    Posted 06 Jan 2008 Link to this post

    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 
  2. T. Tsonev
    Admin
    T. Tsonev avatar
    2772 posts

    Posted 07 Jan 2008 Link to this post

    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. drgorin
    drgorin avatar
    10 posts
    Member since:
    Aug 2012

    Posted 07 Jan 2008 Link to this post

    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.   
  5. T. Tsonev
    Admin
    T. Tsonev avatar
    2772 posts

    Posted 08 Jan 2008 Link to this post

    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
Back to Top