There is already an object named 'FK_OSS_KBN_PC' in the database.(Error: 14151, Severity: 18, State: 1)

  • Hi All,

    I am getting this below error and i can't figure out why this is happening.if anyone has ever encountered this please suggest me on the same.

    Error: 14151, Severity: 18, State: 1.

    Replication-Replication Distribution Subsystem: agent ******** failed. There is already an object named 'Foriegn key name' in the database.

    We are using Transactional up datable replication.This error occurring continuously.

    I have checked the synchronization status.There i am getting message like "There is already an object named 'Foreign key name' in the database"

    At Replication monitoring i am getting errors like

    There is already an object named 'Foreign key name' in the database. (Source: MSSQLServer, Error number: 2714)

    Get help: http://help/2714

    Please advice on the same.

  • At the subscriber, that foreign key already exists somehow so the replication can't create it. Drop or rename the one in the subscriber database.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Hi Sir

    Thanks for the quick reply.

    I have checked the details of that Foreign Key.I checked the created _ datetime in both publisher and subscriber.

    In subscriber :1.07AM

    In Publisher :1.21AM

    I think this is causing the issue.If we drop r rename will there be any impact .Any prerequisites we have to take for this??

    Kindly suggest me on the same.

  • It's not a duplicate key. It's a foreign key with the same name.

    Check the subscriber database for objects with that name. If you find one, either drop it (if it's the same foreign key that the replication is trying to create) or rename it.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Sorry for the inconvenience.i provided wrong timings.Please find the below details

    At publisher it was created :1.20Am

    At Subscriber it was created :2.12Am

  • Was it created manually or was it created by the replication agents?

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • If we do rename will there be any impact

  • As long as it's a different object (not exactly the same foreign key that the replication is trying to create), should be OK as long as no code references it.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Hi,

    We didn't create that Key.And today we are getting again the below error.

    Error:

    The subscription(s) have been marked inactive and must be reinitialized. NoSync subscriptions will need to be dropped and recreated. (Source: MSSQLServer, Error number: 21074)

    Note:We have kept subscription never expires.Still why we are getting this error.

    I am not getting clear idea about rename and dropping key.Is it ok to rename or drop the foreign key with same name from subscriber??

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

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