Go Back   HostGator Peer Support Forums > General Discussion > Webhosting

Notices

Reply
 
Thread Tools
  #1  
Old 09-16-2008, 05:21 PM
eevanich eevanich is offline
Hatchling Croc
 
Join Date: Aug 2008
Posts: 8
Default Primary key to foreign key.

If i have set up a primary key in one table and i want it to be the foreign key in another table in my database, how do i like it to the second table?
Reply With Quote
  #2  
Old 09-16-2008, 05:30 PM
slapshotw's Avatar
slapshotw slapshotw is offline
Veteran Croc
 
Join Date: Jun 2006
Posts: 5,164
Default Re: Primary key to foreign key.

You can use alter table. Something to the effect of:
Code:
alter table *tableName* add Foreign Key (column) references othertable(otherColumn)
.
__________________
Follow me on Twitter! http://twitter.com/mrw
Reply With Quote
  #3  
Old 09-17-2008, 11:14 PM
eevanich eevanich is offline
Hatchling Croc
 
Join Date: Aug 2008
Posts: 8
Default Re: Primary key to foreign key.

Thanks, that worked great
Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Primary Domain Name spaguy Shared Hosting Support 7 09-16-2008 11:51 AM
HG supports .com as primary, is .co.uk ok cumro25 Shared Hosting Support 3 05-12-2008 04:58 AM
Euro + foreign languages Templateshop Pre-Sales Questions 3 09-13-2004 03:25 PM

All times are GMT -5. The time now is 11:32 PM.