Transactional Replication with truncate

  • hi guys, i have a table that i have set up for transactional replication.

    this table gets populated with new data twice a day with a stored procedure containing a truncate table statement and an insert statement.

    My question is when i run the transaction replication would the subscriber table also be trunncated or would it only keep inserting the data?

  • As per MSDN...

    You cannot use TRUNCATE TABLE on tables that:

    * Are referenced by a FOREIGN KEY constraint.

    * Participate in an indexed view.

    * Are published by using transactional replication or merge replication.

    -Roy

  • ok thanks can i use delete?

  • Yes, you can use delete. And the delete will be propagated to the Subscriber.

    PS: You can actually tell the replication agent not to propagate the delete command using some setting. I am not sure what the setting is since I have never used it. I read it somewhere here itself.

    -Roy

  • thank you!

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply