Replication???

  • My database ''ABC" is configured with snapshot to Sub 1 and transactional replication to Sub 2. last week i drop transactional replication then i want to truncate all tables data keeping snapshot publication. i was not able truncate.

    Is this a bug ? after dropping snapshot replication i was able to truncate. Any clue?

  • As far as I know it's not a bug, it's by design - If any table/article is included in any active publication, then it cannot be truncated. From BOL "It is not permitted because replication cannot track the changes caused by the operation: transactional replication tracks changes through the transaction log; merge replication tracks changes through triggers on published tables."

    For your reference:

    http://msdn.microsoft.com/en-us/library/ms151740.aspx

    ______________________________________________________________________________Never argue with an idiot; Theyll drag you down to their level and beat you with experience

  • But after dropping transactional replication keeping snapshot i am not able truncate the data from that table. In spahot we can always truncate.

  • "Dropping transactional replication" - exactly what did you drop? Just the publication? Subscription?

    ______________________________________________________________________________Never argue with an idiot; Theyll drag you down to their level and beat you with experience

  • both

  • Per BOL (see if any of these are true for your situation) - maybe this table has an FK relationship to another table? Or you have CDC enabled?

    If that doesn't work, script out the DDL and simply drop and recreate the table.

    ______________________________________________________________________________Never argue with an idiot; Theyll drag you down to their level and beat you with experience

  • thanks, i will try that option. database doesnt have CDC or fk's defined.

Viewing 7 posts - 1 through 6 (of 6 total)

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