Click here to Skip to main content
14,269,359 members
Rate this:
Please Sign up or sign in to vote.
See more:
CREATE TABLE flotable
(
id int,
s95id varchar(10),
tagname varchar(10),
tagvalue varchar(10),
PRIMARY KEY(id,s95id)
)

How do i create foreign key in another table by referring to this primary key?
Posted
Comments
Ankur\m/ 17-Feb-14 4:12am
   
Why don't you do some reading rather than asking every step here? A simple Google will answer your queries.
Siva Hyderabad 17-Feb-14 4:13am
   
what have you tried so far?

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

CREATE TABLE flotable
(
id int not null,
s95id ]int not null,
tagname varchar(10),
tagvalue varchar(10),
p_id int,
PRIMARY KEY (id,s95id),
CONSTRAINT fk_PerOrders FOREIGN KEY (P_Id)
REFERENCES DimAccount(accountkey)
)
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100