Foreign key conflict unable to delete data from stored procedure

  • I have a Parent table A: For which I wrote Stored procedure which is pulling data from TAble C into Table A from other server.While pushing data into Table A , I am also updating table B (child table of Table A).Table B holds the history of each entry from Table A.

    My question is :

    In the Stored Procedure which is doing pushing of data from table C to table A.

    In this procedure ,how do I write delete in stored procedure to delete data from Table A as well as table C(child table ) based on condition.

    example of Delete I am using in Stored Proc:

    Delete from Table A where Input_type like 'COLD%'

  • can you provide some DDL please sample data etc

    ***The first step is always the hardest *******

  • We need to see how the data is related between the two tables to be able to help you.

  • Thanks I deleted from Child table in Storedprocedure and then data from parent table.

Viewing 4 posts - 1 through 3 (of 3 total)

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