1 Replies - 1412 Views - Last Post: 09 June 2012 - 03:21 PM Rate Topic: -----

#1 CapC  Icon User is offline

  • New D.I.C Head

Reputation: 3
  • View blog
  • Posts: 30
  • Joined: 27-September 11

Whooops!

Posted 31 May 2012 - 03:41 PM

I didn't end up laughing much when I found this nice little gem nestled into some update processing I was working on in an attempt to assist in figuring out why there was nothing being loaded into a specific staging table.

Essentially deleting all records from the t_table where 1=1.



DELETE FROM t_provid
WHERE EXISTS
  ( select prov_name p
     from ind
     where p.prov_name = prov_name
   );



This post has been edited by CapC: 31 May 2012 - 03:43 PM


Is This A Good Question/Topic? 1
  • +

Replies To: Whooops!

#2 Valek  Icon User is offline

  • The Real Skynet
  • member icon

Reputation: 542
  • View blog
  • Posts: 1,713
  • Joined: 08-November 08

Re: Whooops!

Posted 09 June 2012 - 03:21 PM

Please tell me they weren't intentionally emptying the table and using that. TRUNCATE is much, much cleaner.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1