Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2006-07-18
9
Medium Priority
?
2,032 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
Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 
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 2000 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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
When trying to connect from SSMS v17.x to a SQL Server Integration Services 2016 instance or previous version, you get the error “Connecting to the Integration Services service on the computer failed with the following error: 'The specified service …
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
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.

715 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