Strange Error: "Column x appears more than once in the result list"

  • Here's one I've never seen before.  I set up trans replication a few weeks ago and it's been running without incident. This morning when it ran, I got this error:

    Column name 'CTM_NBR' appears more than once in the result column list.

    I got that error for the first 5 columns for this job and for the other replication jobs--- across the board - very strange. It's in a developement environment, so I thought someone mucked around with table schemas or something, but I can't find anything wrong.    Any ideas ?      

  • Nevermind....... A developer had put triggers on the subscription tables, but there are errors in the triggers that reference field names multiple times .

  • 'CTM_NBR' field is duplicate your Insert Statement fix it

  • Hello,

     

    I am getting the same error. Please could you give me more details about your resolution...

     

    Thanks,

  • I don't remember exactly.  But I think it was a combination of table schema changes, and triggers put on tables based on the old schema, not the new schema that messed it up ..... not a typical scenario.  I'm not sure what else might cause that error. double check that the table at the publisher matches the table at the subscriber.  Do you have triggers involved ?  Or recent schema changes ?

  • Hello,

    I found the same field called twice by different queries because they were wrongly created:

    EXEC sp_addviewdef N'Workitem_only_view', N'workitem.floor AS workitem_floor', N''

    GO

    EXEC sp_addviewdef N'Workitem_only_view', N'workitem.floor AS workitem_room', N''

    GO

    I think it is a wrong copy/paste...

    Thanks

  • Definitely you have to maintain some "developer control" on your workflow 😉


    * Noel

  • Hi to all,

    I got the solution of this problem in my case.

    As mentioned above in this post First i check the Trigger on my table

    using sp_helptrigger 'table_name'

    and found there is no trigger on this table. After that I check my insert statment in this i found that i use single column 'DateCol' twice. So that statment create problem for me. That's why i got this problem. After removing this field i face no problem with the query,

    But at last.. It is very different kind of error. which i never faced in query.

    Thanks & Regards

    Shashi Kant chauhan

  • For me, after hours of work thinking it was related to Golden Gate replication, I realized it was probably a SQL Server issue, bounce the SQL Server service, and the problem disappeared.

    I have no idea how SQL Server got horked or why, but it seems it was only temporary.

Viewing 9 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic. Login to reply