• Probably neither. Cursors should be avoided wherever possible, and I don't see a reason for a temp table here.

    You just want to delete the data relating to Project P1? If so, please can you post actual table definitions (with foreign keys) so we can see how the tables are related

    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