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
 Import/Export (DTS) and Replication (2000)
 Insert Trigger Failure into Replicated Table

Author  Topic 

Manubo
Starting Member

5 Posts

Posted - 2006-11-02 : 16:26:57
Hello,

i create two tables with identicalys atributes.
In table (1) i implemented a delete trigger which insert the deleted
rows into table (2).
Its works fine.

Then

I replicate table (2) to an identical table (3) on other server.
and now the replication is working but the insert from table (1) -> table (2) fails with the message not enough insert values.

How can it fix it?

Thanks

jhocutt
Constraint Violating Yak Guru

385 Posts

Posted - 2006-11-02 : 16:28:38
Replication added columns to your table.
Add them to your archive table

"God does not play dice" -- Albert Einstein
"Not only does God play dice, but he sometimes throws them where they cannot be seen."
-- Stephen Hawking
Go to Top of Page

Manubo
Starting Member

5 Posts

Posted - 2006-11-02 : 16:31:10
Thanks for the fast answer.

in the Enterprise Manager i didn´t see a new column !


Manubo
Go to Top of Page

jhocutt
Constraint Violating Yak Guru

385 Posts

Posted - 2006-11-02 : 16:33:36
refresh

"God does not play dice" -- Albert Einstein
"Not only does God play dice, but he sometimes throws them where they cannot be seen."
-- Stephen Hawking
Go to Top of Page

Manubo
Starting Member

5 Posts

Posted - 2006-11-02 : 16:35:53
I refresh but nothing news.

it this column hidden?
Go to Top of Page

jhocutt
Constraint Violating Yak Guru

385 Posts

Posted - 2006-11-02 : 17:08:13
You do not see a column msrepl_synctran_ts that is a datetime


"God does not play dice" -- Albert Einstein
"Not only does God play dice, but he sometimes throws them where they cannot be seen."
-- Stephen Hawking
Go to Top of Page

Manubo
Starting Member

5 Posts

Posted - 2006-11-02 : 18:00:12
I didn't see it.

it is enough when i insert actual getdate() into this for me hidden column?
Go to Top of Page

jhocutt
Constraint Violating Yak Guru

385 Posts

Posted - 2006-11-02 : 18:07:53
Hmm seems I should spend more time reading and less answering.
Table 2 had a column added when you replicated it to table 3 (now they both have msrepl_synctran_ts )
This column is used to tell what data needs to be replicated.
If you are going to insert deleted rows from table 1 which does not have this column you should specify all columns except msrepl_synctran_ts in your insert statement and dont use *.



"God does not play dice" -- Albert Einstein
"Not only does God play dice, but he sometimes throws them where they cannot be seen."
-- Stephen Hawking
Go to Top of Page

Manubo
Starting Member

5 Posts

Posted - 2006-11-02 : 18:17:29
Jhocutt thanks for all answers and soory for my poor english.

I have done it in the delete trigger without * at following way
but i think now in "from delete"

insert tablename
select attr1, attr2,...attrn
from delete

thank you again !

Go to Top of Page
   

- Advertisement -