Solved

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

Posted on 2006-07-18
9
1,961 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

 
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
I have a large data set and a SSIS package. How can I load this file in multi threading?
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

635 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