Solved

Can this table have a FK?

Posted on 2011-09-08
3
209 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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

If you having speed problem in loading SQL Server Management Studio, try to uncheck these options in your internet browser (IE -> Internet Options / Advanced / Security):    . Check for publisher's certificate revocation    . Check for server ce…
In this article I will describe the Backup & Restore 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.

830 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