Solved

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

Posted on 2006-07-18
9
1,830 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
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
 
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
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.

 
LVL 2

Author Comment

by:Michin
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:Michin
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:Michin
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

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Best Approach for querying across several columns. 15 54
triggered use of sp_send_dbmail failure 2 21
Permissions on Database 11 36
sql server query from excel 3 56
Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Viewers will learn how the fundamental information of how to create a table.

939 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

4 Experts available now in Live!

Get 1:1 Help Now