• Actually, I'm puzzled. Since the value of @nKeyWord_IdArg isn't set anywhere, I'd expect it to be NULL and therefore no deletion should be attempted. Unless ANSI_NULLS is set to OFF?

    John

    Edit - forget that. I see what's happened. The parameter is declared as an output parameter but used as an input parameter, and the value is set when the stored procedure is called. Very confusing!