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
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Relation 1 to 1 problem.

Author  Topic 

hdv212
Posting Yak Master

140 Posts

Posted - 2008-08-09 : 15:54:03
Hi
i have two tables that i want create 1 to 1 relation between them, but i want when i value changed in table1, it capture change in table2 and when value changes in table2, it capture change in table1, but how to do this ?
i can't implement this by foreign-key, because it need to refer to unique or pk column.
can anyBody have new idea ?
thanks

jezemine
Master Smack Fu Yak Hacker

2886 Posts

Posted - 2008-08-09 : 16:38:18
if you can't use FK, you could use a trigger.


elsasoft.org
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-08-10 : 02:26:23
or even use OUTPUT clause in you procedure itself to reflect the changes onto table 2 if you're using sql 2005.
Go to Top of Page
   

- Advertisement -