By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,442 Members | 1,316 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,442 IT Pros & Developers. It's quick & easy.

Cannot Find Table or Constraint

P: 1
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

Expand|Select|Wrap|Line Numbers
  1. CREATE TABLE MOVSTARDIR
  2. (
  3. MVNUM SHORT NOT NULL,
  4. STARNUM SHORT NOT NULL,
  5. DIRNUM SHORT NOT NULL,
  6. BESTM INT,
  7. BESTF INT,
  8. SUPM INT,
  9. SUPF INT,
  10. PRIMARY KEY (mvnum, starnum, dirnum),
  11. FOREIGN KEY (mvnum) REFERENCES MOVIE,
  12. FOREIGN KEY (starnum) REFERENCES STAR,
  13. FOREIGN KEY (dirnum) REFERENCES DIRECTOR
  14. );
Oct 28 '13 #1
Share this Question
Share on Google+
3 Replies


Rabbit
Expert Mod 10K+
P: 12,430
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.
Oct 28 '13 #2

NeoPa
Expert Mod 15k+
P: 31,768
It appears clear this is a SQL Server (or T-SQL) question, so I've moved it to that forum for you.
Oct 28 '13 #3

P: 2
@Rabbit is right, do you have these tables you are referring to?
Oct 30 '13 #4

Post your reply

Sign in to post your reply or Sign up for a free account.