Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 39419
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T14:51:43+00:00 2026-05-10T14:51:43+00:00

I have never hand-coded object creation code for SQL Server and foreign key decleration

  • 0

I have never ‘hand-coded’ object creation code for SQL Server and foreign key decleration is seemingly different between SQL Server and Postgres. Here is my sql so far:

drop table exams; drop table question_bank; drop table anwser_bank;  create table exams (     exam_id uniqueidentifier primary key,     exam_name varchar(50), ); create table question_bank (     question_id uniqueidentifier primary key,     question_exam_id uniqueidentifier not null,     question_text varchar(1024) not null,     question_point_value decimal,     constraint question_exam_id foreign key references exams(exam_id) ); create table anwser_bank (     anwser_id           uniqueidentifier primary key,     anwser_question_id  uniqueidentifier,     anwser_text         varchar(1024),     anwser_is_correct   bit ); 

When I run the query I get this error:

Msg 8139, Level 16, State 0, Line 9 Number of referencing columns in foreign key differs from number of referenced columns, table ‘question_bank’.

Can you spot the error?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T14:51:43+00:00Added an answer on May 10, 2026 at 2:51 pm
    create table question_bank (     question_id uniqueidentifier primary key,     question_exam_id uniqueidentifier not null,     question_text varchar(1024) not null,     question_point_value decimal,     constraint fk_questionbank_exams foreign key (question_exam_id) references exams (exam_id) ); 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have never used Foxpro before. Can you convert the following Foxpro code into
I have an object that is called from two different threads and after it
I have never saved and retrieved an image to and from the database before.
I have never programed in bash before. I am reading all the files that
I have never come across this issue but most recently I noticed that a
I have never done any Windows coding and I would like to give it
I have never programmed a gadget for Vista or Seven, but I would like
I have never thought about until recently, but I'm not sure why we call
I have never used Perl, but I am really impressed by the ack ,
I have never made a blog before. I am proficient with html and css.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.