Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Can this table have a FK?

Posted on 2011-09-08
3
Medium Priority
?
235 Views
Last Modified: 2012-05-12
In SQL Server 2005, I've added a new table: TableNew.  In an existing table, I've added a new column that is a reference to TableNew:

    OldTable.TableNewId

TableNewId will have to allow null since there are records in the table.  New records will add a value in this column. Since the column allows null, is it possible to create a FK to TableNew.TableNewId?  Is that needed at this point?
0
Comment
Question by:brettr
  • 2
3 Comments
 
LVL 32

Accepted Solution

by:
Ephraim Wangoya earned 2000 total points
ID: 36506983

You can create the key but you cant have any referential integrity checks
0
 

Author Comment

by:brettr
ID: 36507021
What good is the key in that case?
0
 
LVL 32

Expert Comment

by:Ephraim Wangoya
ID: 36507216
Precisely
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

by Mark Wills PIVOT is a great facility and solves many an EAV (Entity - Attribute - Value) type transformation where we need the information held as data within a column to become columns in their own right. Now, in some cases that is relatively…
I am showing a way to read/import the excel data in table using SQL server 2005... Suppose there is an Excel file "Book1" at location "C:\temp" with column "First Name" and "Last Name". Now to import this Excel data into the table, we will use…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …

927 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question