Solved

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

Posted on 2006-07-18
9
1,861 Views
Last Modified: 2008-02-01
I'm creating a transaction replication.  Pushing data fromt he publisher to the subscriber and after the snapshot creates and the data starts to synch I get this error.  Beyond me as to what to do, I have never run into this error before.  Any ideas?

I have tried messing with the articles here and there to see if I can get it to work by modifying that but no luck.
0
Comment
Question by:Matt Grofsky
  • 5
  • 3
9 Comments
 
LVL 75

Expert Comment

by:Aneesh Retnakaran
ID: 17135781
Try enabling the output logging for a replication agent
http://support.microsoft.com/default.aspx?scid=kb;en-us;312292&Product=sql2k
0
 
LVL 75

Expert Comment

by:Aneesh Retnakaran
ID: 17135785
and post the output of the log file
0
 
LVL 75

Expert Comment

by:Aneesh Retnakaran
ID: 17135793
I hope there exists some sp (May be you have renamed it using sp_rename ) where you are inserting without specifying the column names.
0
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
LVL 28

Expert Comment

by:imran_fast
ID: 17136312
Hi Michin,
From the error above it looks as if you have configured the replication with the subscriber before and then droped it and now again configuring the replication between this subscriber and the publisher. This problem arives from either of the two.

1. Either there are some stored procedure used by the replication which are not in synch with the publisher so for that drop the subscribtion and reinitialize it.

2. Second on the subscriber there are tirggers on the replicated table which are not refering to the tables whose structure is different.
0
 
LVL 2

Author Comment

by:Matt Grofsky
ID: 17137648
aneeshattingal

This is the actual log of where the error occurs.  I would post the entire log but its rather large to post here.

In the below log section "addDupe" is a store procedure in my database.  Perhaps I should not be synchronizing stored procedures?

imran_fast

You are correct I have tried to configure the replicationw itht he subscriber before and then dropped it and tried again.  I will look into either of the two options you mentioned and see if working with those helps at all.


[7/19/2006 5:24:06 AM]SECONDARYDATABASE.IVRSystem: SET QUOTED_IDENTIFIER ON

[7/19/2006 5:24:06 AM]SECONDARYDATABASE.IVRSystem: drop procedure "AddDupe"

[7/19/2006 5:24:06 AM]SECONDARYDATABASE.IVRSystem: CREATE PROCEDURE "AddDupe"
(


@PhoneNumber varchar(50),
@GroupNumberNew varchar(100),
@CompanyID int


)

AS
SET NOCOUNT ON



INSERT INTO IVRTranscriptions
SELECT Top 1 FirstName,LastName,Address,City,State,Zip,Country,Phone,Gender,Prayer,DateEntered=GetDate(),CompanyID=@CompanyID,EmployeeID=1,Metro,GroupNumber=@GroupNumberNew,IPAddress='127.0.0.1',TimeToTranscribe=0,CassCert,EmailAddress,DeliveryPointBarCode,Checked,CassTries=0,GenderChecked
FROM IVRTranscriptions
WHERE Phone = @PhoneNumber and city <> ''

Agent message code 20046. Insert Error: Column name or number of supplied values does not match table definition.
[7/19/2006 5:24:06 AM]F9186.distribution: {call sp_MSadd_distribution_history(8, 6,  ?, ?, 0, 0, 0.00, 0x01, 1, ?, 64, 0x01, 0x01)}
Adding alert to msdb..sysreplicationalerts: ErrorId = 12,
Transaction Seqno = 0000a9fe0000007202ce00000001, Command ID = 64
Message: Replication-Replication Distribution Subsystem: agent F9186-IVRSystem-SECONDARYDATABASE-8 failed. Insert Error: Column name or number of supplied values does not match table definition.[7/19/2006 5:24:06 AM]F9186.distribution: {call sp_MSadd_repl_alert(3, 8,  12, 14151, ?, 64, N'F9186', N'IVRSystem', N'SECONDARYDATABASE', N'IVRSystem', ?)}
ErrorId = 12, SourceTypeId = 5
ErrorCode = '213'
ErrorText = 'Insert Error: Column name or number of supplied values does not match table definition.'
[7/19/2006 5:24:06 AM]F9186.distribution: {call sp_MSadd_repl_error(12, 0,  5, ?, N'213', ?)}

Category:SQLSERVER
Source:  SECONDARYDATABASE
Number:  213
Message: Insert Error: Column name or number of supplied values does not match table definition.
[7/19/2006 5:24:06 AM]SECONDARYDATABASE.IVRSystem: exec dbo.sp_MSupdatelastsyncinfo N'F9186',N'IVRSystem', N'', 0, 6, N'Insert Error: Column name or number of supplied values does not match table definition.'
Disconnecting from Subscriber 'SECONDARYDATABASE'
Disconnecting from Distributor 'F9186'
Disconnecting from Distributor History 'F9186'
0
 
LVL 75

Accepted Solution

by:
Aneesh Retnakaran earned 500 total points
ID: 17137737
now check the table structure of 'IVRTranscriptions'  check whether the foillowing script runs ...


INSERT INTO IVRTranscriptions
SELECT Top 1 FirstName,LastName,Address,City,State,Zip,Country,Phone,Gender,Prayer,DateEntered=GetDate(),CompanyID=@CompanyID,EmployeeID=1,Metro,GroupNumber=@GroupNumberNew,IPAddress='127.0.0.1',TimeToTranscribe=0,CassCert,EmailAddress,DeliveryPointBarCode,Checked,CassTries=0,GenderChecked
FROM IVRTranscriptions
WHERE Phone = @PhoneNumber and city <> ''
0
 
LVL 2

Author Comment

by:Matt Grofsky
ID: 17138390
when I run it in query analyzer on the prublisher I get pretty much the same message

Server: Msg 213, Level 16, State 4, Line 5
Insert Error: Column name or number of supplied values does not match table definition.
0
 
LVL 2

Author Comment

by:Matt Grofsky
ID: 17138479
Well it looks like it has something to do with that particular SP..I will have to investigate that, once I set up to publish and did not choose that SP it worked.  Thanks for the help aneeshattingal , that log output helped out a lot.
0
 
LVL 75

Expert Comment

by:Aneesh Retnakaran
ID: 17138524
Ok Coll.. Go ahead
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question