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)
 problem with which order to run triggers in

Author  Topic 

Robwhittaker
Yak Posting Veteran

85 Posts

Posted - 2002-11-20 : 10:12:36
Hi,

I've got an interesting problem, where I want to copy data that is inserted in to two tables that belong to a 3rd party application in to some of my tables.

All these tables are in the same database and I am allowed to add triggers on to the tables.

However the data is related and I cannot copy one chunk without the other. One of the tables is populated us MSMQ Queueing server and the other by direct writes (but this is saved second). Therefore I don't know which order the data will be inserted in to the tables, and so can't just stick a trigger on the table that will be last update.

My current thoughts are to put a trigger on both tables, and then checks if the data is in the other table before doing and insert in to my tables. This will mean that I will always get the data in a correct state.

Has anybody got any better suggestions, opinions?

Rob

KnooKie
Aged Yak Warrior

623 Posts

Posted - 2002-11-20 : 10:36:38
You could perhaps have 2 'holding tables' that you could use to chuck the data in prior to putting it into your system. You wouldn't need to care in which order these are populated as you don't need to relate them together.

Once the holding tables have been populated you then have complete control as to how you populate your 'live' database.

A thought anyway.

===========
Paul
Go to Top of Page
   

- Advertisement -