jeudi 8 janvier 2015

How to link tables in SQL


Vote count:

0




I have two tables and i want to create a third that references the other two.


stock_group has groupno as primary key

stock_group2s also has groupno as primary key


I want to create table called stock_group3s, with 5 columns:



key int AUTO INCREMENT PRIMARY KEY
groupno INT
group1 [stock_group.groupno]
group2 [stock_group@s.groupno]
name VARCHAR (30)


The two linked columns then must contain only a value that can be found in their referenced tables.


How do set this up? I am using SQL2008R2 with SQL Management Studio 2008



asked 35 secs ago

Bevan

114






How to link tables in SQL

Aucun commentaire:

Enregistrer un commentaire