Solved

Can this table have a FK?

Posted on 2011-09-08
3
180 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:
ewangoya earned 500 total points
Comment Utility

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

Author Comment

by:brettr
Comment Utility
What good is the key in that case?
0
 
LVL 32

Expert Comment

by:ewangoya
Comment Utility
Precisely
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

by Mark Wills Attending one of Rob Farley's seminars the other day, I heard the phrase "The Accidental DBA" and fell in love with it. It got me thinking about the plight of the newcomer to SQL Server...  So if you are the accidental DBA, or, simp…
So every once in a while at work I am asked to export data from one table and insert it into another on a different server.  I hate doing this.  There's so many different tables and data types.  Some column data needs quoted and some doesn't.  What …
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

772 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now