No announcements
Found 2327435 threads
-
1 Votes
Does a foreign key have to be a primary key
Link is created between two tables when the column or columns that hold the primary key value for one table are referenced by the column or columns in ...Answered | 9 Replies | 2222 Views | Created by Divideby - Wednesday, July 30, 2014 10:43 AM | Last reply by Ahsan Kabir - Thursday, August 7, 2014 6:12 AM -
0 Votes
how to create 2 tables with primary key ,foreign key relationship in sql
thank u but I want to put foreign key relation in second table like orders (P_id )is Primary key in this table ), if First ...Answered | 5 Replies | 1516 Views | Created by Shanthi.Thamada - Saturday, June 6, 2015 5:19 AM | Last reply by scott_morris-ga - Monday, June 8, 2015 1:00 PM -
0 Votes
can we have a Foreign key and Primary key on the same table?
i dont think so there is any issue in making compsite keys that are primary key reference to another table.Answered | 5 Replies | 4753 Views | Created by Incredible15 - Friday, May 28, 2010 3:30 PM | Last reply by Muhammad Abbas - Monday, May 31, 2010 1:19 PM -
0 Votes
Foreign Key on a column which is not Primary Key of the table
Check this link http://msdn.microsoft.com/en-us/library/ms189049.aspx Limitations and Restrictions A foreign key constraint ...Answered | 3 Replies | 1344 Views | Created by SqlShan - Friday, August 1, 2014 3:37 PM | Last reply by --CELKO-- - Friday, August 1, 2014 10:06 PM -
0 Votes
Why does creating primary key create an index but creating foreign key does not
On the other hand - primary key is always used for table lookups - makes sense to create an index (by default it's not clustered - again no assumptions).Answered | 4 Replies | 5402 Views | Created by MGS66 - Wednesday, November 10, 2010 4:14 AM | Last reply by Chirag Shah - Wednesday, November 10, 2010 5:51 PM -
0 Votes
Primary Key and Foreign Key
For example, suppose you have a Products table with primary key ProductID and an Orders table with primary key OrderID ...Answered | 4 Replies | 1355 Views | Created by Ronald Rex - Sunday, September 9, 2018 12:21 AM | Last reply by Ronald Rex - Sunday, September 9, 2018 7:02 PM -
1 Votes
Primary key and Foreign Key
See this illustration create table t ( id int identity(1,1) not null primary key, val varchar(100) ) create ...Answered | 4 Replies | 1647 Views | Created by smtaqi - Saturday, August 30, 2014 8:08 AM | Last reply by Visakh16 - Saturday, August 30, 2014 6:59 PM -
0 Votes
Foreign Key from two primary tables
This stackoverflow thread explains how you should solve this issue by designing your database ...Answered | 4 Replies | 9955 Views | Created by Rahul Maurya - Friday, March 18, 2011 11:49 AM | Last reply by Rahul Maurya - Tuesday, April 5, 2011 4:58 AM -
0 Votes
Is it possible to have primary key and foreign key in one table
Example is having Parent Child relationship Table.Answered | 3 Replies | 4296 Views | Created by SunilJena - Monday, October 18, 2010 10:44 AM | Last reply by Manoj Pandey (manub22) - Monday, October 18, 2010 11:19 AM -
0 Votes
primary and foreign key constraints
I am working to add each of the tables to the database, with their primary and foreign keys where I believe they are applicable.Answered | 7 Replies | 8416 Views | Created by hfinny - Wednesday, May 5, 2010 11:20 PM | Last reply by Louis Davidson - Thursday, May 6, 2010 8:46 PM -
2 Votes
primary foreign key referencing
This means that a primary key can be a primary and a foreign key at the same time in the same table?Answered | 9 Replies | 9891 Views | Created by N.Afache - Friday, October 21, 2011 11:51 AM | Last reply by J Alverson - Sunday, October 30, 2011 7:32 AM -
0 Votes
How to set two foreign keys as primary key of a table in sql server
Try: CREATE TABLE [dbo].Answered | 3 Replies | 4793 Views | Created by Royal Oak - Thursday, October 1, 2009 11:50 PM | Last reply by Royal Oak - Friday, October 2, 2009 1:22 AM -
2 Votes
Can Primary Keys that are "composite" be used as foreign keys in other tables?
There is no problem setting up a foreign key using a composite primary key; however, this require creating all these fields in the foreign ...Answered | 3 Replies | 7346 Views | Created by BradleyA - Thursday, August 12, 2010 5:34 PM | Last reply by BradleyA - Thursday, August 12, 2010 7:39 PM -
2 Votes
Foreign key references a two column primary key
There is absolutely no workaround to have a foreign key with one column referencing to a primary key of two columns?Answered | 13 Replies | 22134 Views | Created by pyram07 - Thursday, June 14, 2012 1:17 PM | Last reply by pyram07 - Thursday, June 14, 2012 6:18 PM -
3 Votes
Composite Primary key and Foreign key
In such tables you usually have extra fields (2 or 4 characters long) that can be used as a primary key.Answered | 18 Replies | 61239 Views | Created by mahima - Friday, February 8, 2008 3:51 PM | Last reply by Kalman Toth - Sunday, April 10, 2011 8:52 PM -
0 Votes
Column is both a Primary Key and Foreign Key
That's why SQL Server automatically sets the column to NOT NULL if the PRIMARY KEY constrained is included in the CREATE TABLE ...Answered | 4 Replies | 17603 Views | Created by Olimicus03 - Friday, November 5, 2010 7:14 PM | Last reply by J Alverson - Friday, November 26, 2010 5:48 AM -
1 Votes
Issue creating Foreign Key in Referenced Table
That error means you do not have a column named ID in table HL7_Patient.Answered | 3 Replies | 842 Views | Created by JaguarsJag - Monday, September 26, 2016 2:28 PM | Last reply by Tom Cooper - Monday, September 26, 2016 4:04 PM -
3 Votes
referencing foreign keys from composite primary keys
CREATE TABLE [facilities].Answered | 4 Replies | 4253 Views | Created by slickk_F - Monday, February 11, 2013 11:42 AM | Last reply by Kalman Toth - Wednesday, February 13, 2013 7:53 PM -
0 Votes
A foreign key referencing primary keys in multiple tables
Thanks But I will have also drop box, journal, forum, etc what about assignment (assignmentid pk,assignmenttitle, ...Answered | 4 Replies | 9877 Views | Created by Semika - Tuesday, March 22, 2011 2:43 PM | Last reply by Uri Dimant - Wednesday, March 23, 2011 3:20 PM -
0 Votes
Proper Script to CREATE TABLE with PRIMARY KEY NONCLUSTERED and CLUSTERED INDEX on FK
REFERENCES used for creating FOREIGN KEY for example, and It can be multi columns as well.Answered | 19 Replies | 1755 Views | Created by MAP Data Consulting Inc - Friday, August 28, 2015 7:09 PM | Last reply by MAP Data Consulting Inc - Sunday, August 30, 2015 8:39 PM - Items 1 to 20 of 2327435 Next ›
No announcements