Weird insert command breaks replication

  • Hi,

    I got replication agent failing due to this error:

    Insert Error: Column name or number of supplied values does not match table definition.

    I've tested this command on the publishing table:

    begin tran

    insert into "MyTable" values ('0000000000000000000000000311713', NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 0, ' ', NULL, NULL, ' ', NULL, NULL, NULL, NULL, NULL, 0, NULL, ' ', NULL, 0, NULL, 0, NULL, 0, NULL, 0, NULL, NULL, ' ', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, ' ', NULL, NULL, NULL, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0.000000000000000e+000, NULL, NULL, NULL, NULL)

    rollback tran

    and got the same error message.

    Thus I assumed the insert did not work on the publisher, but how come did it got into the replication?

    Thanks.

  • Just found this out.  The article had only some of the columns replicated, so the command obviously could not be executed on the publisher table.  As for the subscriber, the database did not properly clean up previous replication information at the time it was refreshed from current backup.

  • Good follow up. Often happens when someone tried to make changes without redoing the snapshot. Nothing wrong with that, but easy to miss something when doing it.

Viewing 3 posts - 1 through 3 (of 3 total)

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