• yuvipoy (3/28/2014)


    1) Ok, Say i am droppping foreign keys and start deleting the records,what will happen in the middle of delete , if the server is broken, how to reenable the Foreign keys .

    2) While running the Delete statement if i stop the query how to reenable the foreign keys(As you said Orphans) any links for that to restore orphans.

    I using SQL Server 2000 only plan to migrate to sql 2005 in middle of next year until that i have to use SQL 2000.So finding best way to deal with delete statements.

    If the scripts stop in the middle, you have problems. There's no getting around that. You'd have to have some secondary step that recreates the FKs, but, if it stopped in a partial state, you could get orphans, yes. There are no simple answers here.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning