Solved

Can this table have a FK?

Posted on 2011-09-08
3
217 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 32

Accepted Solution

by:
Ephraim Wangoya 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:Ephraim Wangoya
ID: 36507216
Precisely
0

Featured Post

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Error when saving to sql table a '/' 5 32
sql query help 2 68
SQL Error - Query 6 54
How to resolve SQL Server DB deadlock which makes my application hangs ? 6 75
I've encountered valid database schemas that do not have a primary key.  For example, I use LogParser from Microsoft to push IIS logs into a SQL database table for processing and analysis.  However, occasionally due to user error or a scheduled task…
In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

738 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