Click here to Skip to main content
15,921,941 members
Please Sign up or sign in to vote.
1.00/5 (1 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

SQL
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)
)
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900