Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. declare @ic as table (custid int) insert into @ic select cus_custid from cusmer
  2. where cus_Custid not in (select pnv_custid from pinvoice) and cus_Custid not in (select ord_custid from orders) and cus_Custid not in (select art_custid from ar_trn)
  3.  
  4. delete shipto where shi_custid in (select * from @ic)
  5. delete cusdet where cdt_custid in (select * from @ic)
  6. delete cussitestats where cst_custid in (select * from @ic)
  7. delete cusstats where css_custid in (select * from @ic)
  8. delete cusmer where cus_custid in (select * from @ic)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement