Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Enforcing Referential Integrity: SQL Server 2008

Author  Topic 

JV28132
Starting Member

1 Post

Posted - 2011-02-28 : 11:20:57
How do I enforce integrity between two tables?

For instance:

Table 1 is the master table and has only unique values and contains a primary key that utilizes Identity and increments by 1 each time an insert is completed .

Table 2 is the detail table and does NOT utilize the Identity specifications, but includes the primary key from Table 1 (above).

Each time an entry into table 1 is created, an entry into table 2 should be countered. And I would like to enforce referential integrity so that this rule is enforced. The two tables should be in-sync at all times.

How would I go about completing this?


Thanks in advance for any help!




   

- Advertisement -