Answered by:
Which one is better Drop or Delete ?

Question
-
I have 3 tables one having 100 Records and other having 250 Records, both these tables are full refresh tables on a weekly basis. Both the tables are date partitioned, having USI on 2 columns each.
These 2 tables store only 2 years of data from the load date.
Load strategy Currently what we have is Delete the entire tables using Delete all and load the data.
Do you think we will have some savings if we approach with below one?
Instead of deleting, if we drop the table and re-create with fresh DDL with only 5 years of partition weekly and load data.Thursday, September 17, 2015 6:58 AM
Answers
-
If there are only 250 rows at most, it seems a bit of overkill to partition...
If there are no referencing foreign keys, you can use TRUNCATE TABLE.
Else I would prefer to delete the data. I don't like changing the schema of the database outside installation of new versions.
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se- Proposed as answer by Eric__Zhang Thursday, September 17, 2015 9:21 AM
- Marked as answer by Jason_Clark03 Thursday, September 17, 2015 10:40 AM
Thursday, September 17, 2015 7:19 AM -
Hi,
Truncate and delete are good option instead of drop .
I dont see any reason to drop the table schema and then re create it again .
Thanks
Abhishek
- Marked as answer by Eric__Zhang Friday, September 25, 2015 8:38 AM
Thursday, September 17, 2015 7:53 AM
All replies
-
If there are only 250 rows at most, it seems a bit of overkill to partition...
If there are no referencing foreign keys, you can use TRUNCATE TABLE.
Else I would prefer to delete the data. I don't like changing the schema of the database outside installation of new versions.
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se- Proposed as answer by Eric__Zhang Thursday, September 17, 2015 9:21 AM
- Marked as answer by Jason_Clark03 Thursday, September 17, 2015 10:40 AM
Thursday, September 17, 2015 7:19 AM -
Hi,
Truncate and delete are good option instead of drop .
I dont see any reason to drop the table schema and then re create it again .
Thanks
Abhishek
- Marked as answer by Eric__Zhang Friday, September 25, 2015 8:38 AM
Thursday, September 17, 2015 7:53 AM