M
M
Michael Vasyukov2017-11-23 20:29:34
SQL
Michael Vasyukov, 2017-11-23 20:29:34

How to join an int primary key to a smallint foreign key?

Greetings! This problem arose: There is a table, it has several columns, the very first column (with a primary key) now I need to set a foreign key to another column, but I can’t do this.
Screenshots:

spoiler
5a17054fa8f43691930050.png
///////////////////////////////////////////////////////////////////////////////////////////////////////////
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
5a17056114986393816261.png
///////////////////////////////////////////////////////////////////////////////////////////////////////////
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
5a17056bd143e792902115.png
///////////////////////////////////////////////////////////////////////////////////////////////////////////
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
5a17057351e12055348619.png
///////////////////////////////////////////////////////////////////////////////////////////////////////////
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
5a17057952c7e783086554.png

How can a secondary key be set without changing its type to int or changing the primary key's type to smallint?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
AVKor, 2017-11-23
@programmer_developer

No way.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question