Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 Database Design and Application Architecture
 SQL Statement Performance Question

Author  Topic 

gvphubli
Yak Posting Veteran

54 Posts

Posted - 2009-09-15 : 12:15:57
Assuming following table "SALES_FORECAST" has 50 million rows in it and about 50% of the rows qualify to be deleted by below statement. Now which of the following statements is better and why ? - DO NOT ASSUME SQL Server lets be generic.

DELETE FROM SALES_FORECAST WHERE FORECAST_DATE < DATE(DAYS(CURRENT_DATE) - 90);

OR

DELETE FROM SALES_FORECAST WHERE FORECAST_DATE < '2009-06-17';



TechnologyYogi
http://gvphubli.blogspot.com/

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2009-09-15 : 12:29:07
The second looks a bit better because the first has unknown syntax in SQL Server ??


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page
   

- Advertisement -