Transactional Replication: Column name or number of supplied values does not match table definition

StackOverflow https://stackoverflow.com/questions/22245416

  •  10-06-2023
  •  | 
  •  

Question

I have set up a transactionnal replication for some tables. The Master and the Slave Database are identical. I used this query and compared the result from master and slave to make sure the table is identical

select * from sys.columns c
join sys.tables t on t.object_id = c.object_id
where t.name = 'customers'

In the Replication Monitor I can find this error: Column name or number of supplied values does not match table definition.

If I check the details I get this: Command attempted:

if @@trancount > 0 rollback tran
(Transaction sequence number: 0x0011775200000105007600000000, Command ID: 1)

So I checked in the destribution database using this query to find the command that is failing.

sp_browsereplcmds @xact_seqno_start = '0x0011775200000105007600000000',
@xact_seqno_end = '0x0011775200000105007600000000'

This is the command (its in 2 lines in that table):

{CALL [sp_MSins_dboCustomers] (0,'575',N'todelete','575',N'todelete',118594,118595,118596,N'10T 3% Sk 30T net.',0,'Deutschland',4,24399158193054E-314,4,24399158193054E-314,4,24399158193054E-314,4,24399158193054E-314,2,54639494915833E-313,'','','','','','TGW',N'Liefern LKW',NULL,NULL,0,0,6,79038653108887E-311,NULL,'',0,NULL,NULL,NULL,0,0,0,-1,-1,1900-01-01 00:00:00,0,1,{AEB3D911-36D1-4A8A-B713-6B2F2CCA1641},0,0,2,'de-AT',25,NULL,NULL,0,1,NULL,NULL,2014-03-07 08:57:45.727,-1,NULL,0,'','','','','','','','','','','','',

'','','','','','','','')}

This is what I have in my DB

TypeID  CustomerID  Name    SiteID  SiteName    AddressID   BillAddressID   ShipAddressID   Terms   TaxExempt   TaxSchedID  TaxPercent  TaxPercent1 TaxPercent2 TaxPercent3 TaxPercent4 TaxTitle    TaxTitle1   TaxTitle2   TaxTitle3   TaxTitle4   LocationID  ShipVia PackingType PackingNoteID   CutoffDay   UploadAction    LeadTime    ExpDays Notes   SalesPersonID   CreditLimit OpenOrders  OrderValueScheduleID    OAHidePrices    DefaultAckType  DefaultInvType  DefaultPackType UploadEmployee  UploadDateTime  OAHideImages    MfgCustomer CustomerGUID    PricingMethod   DefaultCustomer EngineeringUnitSetID    CurrencyCulture FamilyGroupID   InvoiceMinimum  InvoiceSurcharge    InvoiceGroup    InvoiceCopies   DeliveryMinimum DeliverySurcharge   CreateDate  EnteredBy   LanguageCulture DropShip    UserDef1    UserDef2    UserDef3    UserDef4    UserDef5    UserDef6    UserDef7    UserDef8    UserDef9    UserDef10   UserDef11   UserDef12   UserDef13   UserDef14   UserDef15   UserDef16   UserDef17   UserDef18   UserDef19   UserDef20
0   575 todelete    575 todelete    118594  118595  118596  10T 3% Sk 30T net.  0   Deutschland 0   0   0   0   0                       TGW Liefern LKW NULL    NULL    0   0   0   NULL        302 NULL    NULL    NULL    0   0   0   -1  -1  1900-01-01 00:00:00 0   1   AEB3D911-36D1-4A8A-B713-6B2F2CCA1641    0   0   2   de-AT   25  NULL    NULL    0   1   NULL    NULL    2014-03-07 08:57:45.727 -1  NULL    0   1   2   3   4                                                                   0   1   2   3   4                                                               

As you can see here, the values for the taxpercent fields (after "Deutschland") are 0 in my DB, in the command they are really weird (4,24399158193054E-314)

The Datatype is "real"

Maybe this is not the issue but this is the only weird thing I could find.

Was it helpful?

Solution

I found my problem. In fact this 4,24399158193054E-314 is a value for "0" in real, the problem is that it did not use the "." but the "," as decimal separator and therefore the call of the procedure had too much argument.

What I did is to change the statement delivery for insert, update, delete from "Call " to INSERT/UPDATE/DELETE statement.

I don't know why this is not selected by default, but now it works.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top