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

  • Home
  • SEARCH
  • 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

Ask A Question

Stats

  • Questions 543k
  • Answers 543k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer It turns out it was using IQueryable rather then IEnumerable… May 17, 2026 at 6:16 am
  • Editorial Team
    Editorial Team added an answer for i in xrange(1, 1746): file = urllib2.urlopen("http://www.example.com/photos/%04d.jpg" % i)… May 17, 2026 at 6:16 am
  • Editorial Team
    Editorial Team added an answer Call [scrollView.layer hitTest:touchPoint];. The return value will be the layer… May 17, 2026 at 6:16 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I have never used octal numbers in my code nor come across any code
I have an object that is called from two different threads and after it
I have never worked with web services and rails, and obviously this is something
I have never seen a way to do this nicely, i would be interested
I have never really found the design view in Visual Studio useful when developing
i have never used LINQ in any of my projects , i have always
I have never used virtualization, and am trying to get up to speed. My
I have a basic cs-major understanding of multi-threading but have never had to do
Before you answer this I have never developed anything popular enough to attain high
After lots of attempts and search I have never found a satisfactory way to

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.