Cannot Find Table or Constraint

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • whatdoido
    New Member
    • Oct 2013
    • 1

    Cannot Find Table or Constraint

    I'm suppose to make a table called MOVSTARDIR, and am suppose to have mvnum, starnum, and dirnum as primary keys with referential integrity enforced but I keep getting Cannt find table or constraint

    Code:
    CREATE TABLE MOVSTARDIR
    (
    MVNUM SHORT NOT NULL,
    STARNUM SHORT NOT NULL,
    DIRNUM SHORT NOT NULL,
    BESTM INT,
    BESTF INT,
    SUPM INT,
    SUPF INT,
    PRIMARY KEY (mvnum, starnum, dirnum),
    FOREIGN KEY (mvnum) REFERENCES MOVIE,
    FOREIGN KEY (starnum) REFERENCES STAR,
    FOREIGN KEY (dirnum) REFERENCES DIRECTOR
    );
    Last edited by Rabbit; Oct 28 '13, 05:59 PM. Reason: Please use [CODE] and [/CODE] tags when posting code or formatted data.
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    The error is a fairly clear one. You are trying to reference a table that doesn't exists. You do not have one or more of the following tables: MOVIE, STAR, DIRECTOR. Those tables need to be created first if you're going to reference them.

    Comment

    • NeoPa
      Recognized Expert Moderator MVP
      • Oct 2006
      • 32636

      #3
      It appears clear this is a SQL Server (or T-SQL) question, so I've moved it to that forum for you.

      Comment

      • SimMed
        New Member
        • Oct 2013
        • 2

        #4
        @Rabbit is right, do you have these tables you are referring to?

        Comment

        Working...