SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Thread: Help the Noob!

  1. #1
    SitePoint Member
    Join Date
    Oct 2009
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Help the Noob!

    This is the code i am typing into Microsft Server Express:-


    Create table tblResults (
    ResultsId Int NOT NULL,
    Grade Varchar(50) NOT NULL,
    Competition Char(50),
    TeamName Char(50),
    Draw Char(20),
    Piping_1 Decimal(2,2),
    Piping_2 Decimal(2,2),
    Ensemble Decimal(2,2),
    Drums Decimal(2,2),
    Drill Decimal(2,2),
    Penalty Decimal(2,2),
    Total Decimal(3,2),
    Place Double,
    TeamId Double NOT NULL,
    CompId Double NOT NULL,
    JudgeId Double NOT NULL,
    GradeId Double NOT NULL,
    Primary Key (ResultsId,TeamId,CompId,JudgeId,GradeId)) ENGINE = MyISAM;

    Create table tblGrade (
    GradeId Double NOT NULL,
    Grade Varchar(50),
    UNIQUE (GradeId),
    Primary Key (GradeId)) ENGINE = MyISAM;

    Create table tblCompetition (
    CompId Double NOT NULL,
    Competition Varchar(50),
    Primary Key (CompId)) ENGINE = MyISAM;

    Create table tblTeam (
    TeamId Double NOT NULL,
    TeamName Varchar(50),
    TeamOrigin Varchar(50),
    GradeEntered Varchar(50),
    CompetitionEntered Varchar(50),
    Draw Varchar(50),
    UNIQUE (TeamName),
    Primary Key (TeamId)) ENGINE = MyISAM;

    Create table tblJudge (
    JudgeId Double NOT NULL,
    JudgeName Varchar(50),
    JudgeType Varchar(50),
    Grade Varchar(50),
    Competitions Varchar(50),
    GradeId Double NOT NULL,
    UNIQUE (JudgeName),
    Primary Key (JudgeId,GradeId)) ENGINE = MyISAM;


    Alter table tblResults add Foreign Key (CompId) references tblCompetition (CompId) on delete restrict on update restrict;
    Alter table tblResults add Foreign Key (TeamId) references tblTeam (TeamId) on delete restrict on update restrict;
    Alter table tblResults add Foreign Key (JudgeId,GradeId) references tblJudge (JudgeId,GradeId) on delete restrict on update restrict;


    I do not know why when i try and executs this, more errors appear.
    Thanks to all who help.

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,022
    Mentioned
    53 Post(s)
    Tagged
    2 Thread(s)
    for one thing, ENGINE = MyISAM is invalid for SQL Server
    r937.com | rudy.ca | Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •