Solved

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

Posted on 2006-07-18
9
1,817 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:Michin
  • 5
  • 3
9 Comments
 
LVL 75

Expert Comment

by:Aneesh Retnakaran
Comment Utility
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
Comment Utility
and post the output of the log file
0
 
LVL 75

Expert Comment

by:Aneesh Retnakaran
Comment Utility
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
 
LVL 28

Expert Comment

by:imran_fast
Comment Utility
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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 2

Author Comment

by:Michin
Comment Utility
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
Comment Utility
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:Michin
Comment Utility
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:Michin
Comment Utility
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
Comment Utility
Ok Coll.. Go ahead
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

I wrote this interesting script that really help me find jobs or procedures when working in a huge environment. I could I have written it as a Procedure but then I would have to have it on each machine or have a link to a server-related search that …
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

743 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now