Solved

Can this table have a FK?

Posted on 2011-09-08
3
192 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
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:ewangoya
ID: 36507216
Precisely
0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

Introduction: When running hybrid database environments, you often need to query some data from a remote db of any type, while being connected to your MS SQL Server database. Problems start when you try to combine that with some "user input" pass…
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

895 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