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 2000 Forums
 SQL Server Development (2000)
 RPC referential integrity via a trigger

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2000-11-20 : 08:45:48
Todd writes "I am looking to enforce RI on two differnet databases via a trigger, where there is not a static link between the 2 databases except an RPC call.

Is there a way to link up 2 databases in a trigger that will cross reference a table based on a join in the trigger to see if the record being inserted or updated in a valid record.

Here is an example. Suppose, I have a master product table in Database1 on server1 and an order table in Database2 on server2. When a record is inserted or updated in the order table, I want a trigger to check the master product table on a different server to see if the product exists. If the product does not exist then I want the insert or update to fail.

This is running on a NT 4.0 server with sql 7.0 with all of the lastest services packs installed

Thanks,

Todd"
   

- Advertisement -