Re: How to syncronize two tables?

From: Louis Davidson (dr_dontspamme_sql_at_hotmail.com)
Date: 01/04/05


Date: Tue, 4 Jan 2005 11:02:19 -0600

What do you mean:

> they works separately, but together they create a conflict?

What is the error message?

-- 
----------------------------------------------------------------------------
Louis Davidson - drsql@hotmail.com
SQL Server MVP
Compass Technology Management - www.compass.net
Pro SQL Server 2000 Database Design - 
http://www.apress.com/book/bookDisplay.html?bID=266
Note: Please reply to the newsgroups only unless you are interested in 
consulting services.  All other replies may be ignored :)
"EarthSpiders" <earthspiders@libero.it> wrote in message 
news:a4183960.0501040742.6d85b6fe@posting.google.com...
>I have 2 db A and B, with 2 tables C and D with the same fields and i
> want to sync them with trigger.
> I wrote this one for the delete:
>
> ****In the db A
>
> CREATE TRIGGER [Delete]
> ON A.[dbo].[C]
>
> FOR DELETE
> AS
>
> DELETE FROM B.[dbo].[D]
> WHERE B.[dbo].[D].Key = (SELECT Key
>          FROM deleted)
>
>
> ****In the db B
>
>
> CREATE TRIGGER [Delete]
> ON B.[dbo].[D]
>
> FOR DELETE
> AS
>
> DELETE FROM A.[dbo].[C]
> WHERE A.[dbo].[C].Key = (SELECT Key
> FROM deleted)
>
>
> they works separately, but together they create a conflict? how can I
> exceed the problem?
> how can i sync the 2 tables? Help!!! 


Relevant Pages

  • Re: NEED TO CALL AS400 S.P
    ... That is to use a trigger on a table and perform an INSERT/UPDATE which will execute the trigger. ... What an error message! ... > what your OLE DB provider is feed the AS400 with? ... > Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se ...
    (microsoft.public.data.oledb)
  • Re: Reality check
    ... the impression that SQL Server was going to be more difficult. ... > Keeping two database in sync with different schema is tricky, ... > database pushing to the other smooth before going two-way. ... > use a trigger to update the updated column with every update. ...
    (microsoft.public.sqlserver.programming)
  • Re: Error on Trigger Launch
    ... It was an error message from Microsoft SQL Server Managment Studio ... trigger, ... If an UPDATE statement affects multiple rows, ...
    (comp.databases.ms-sqlserver)
  • Re: help with DDL trigger. Moved from other newsgroup.
    ... something about this trigger causes a prior table "tblA" to ... Here is the error message that I get on inserting into tblA with the ... you use XQuery, these settings must be on: ... Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx ...
    (comp.databases.ms-sqlserver)
  • Re: Error on Trigger Launch
    ... trigger, ... the row unique or they alter multiple rows" ... That does not sound like a SQL Server error message. ...
    (comp.databases.ms-sqlserver)

Loading