SQL Server Query -- How to continue on error -


i have table containing thousands of fields , of them duplicated due customer's failure , need fix it. can find them , delete them row row, looking faster work around.

as of these related other tables, can not deleted directly without taking care of relation. wand first delete not included in relationship running simple delete command without conditions, unrelated rows deleted , rest of them can done rapidly.

here question, can skip errors , delete unrelated rows? when run query, stops when first related id found.(the conflict occurred in database ....)

any suggestions?

you use outer join deletion (where related table other side of join), id null in outer join, it's safe delete won't constraint violation.

however, huge, unbounded deletions sounds massive risk me, ensure have backups.


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -