The 'smart' delete

Deleting rows from SQL Server database table is not as simple as it sounds.

The ‘straight forward’ delete – go delete, no matter what!

Yes, there is the DELETE statement:

?View Code TSQLDELETE table_1 WHERE ColumnName = ‘some_value’

What is the problem with that?

There are several problems:

transactions and logging
disk space
time consuming
locking and concurrency
IO throughput
parallelism, if present

So, it depends how

Continue reading […] The ‘smart’ delete […]

 

A bit more on recompilation in SQL Server

SQL Server takes care of compilation and recompilation automatically, as we all know. The first time a statement is executed, the SQL Server query optimizer checks if there is a plan already cached, looks at the statistics related to the objects involved in the statement and uses a sophisticated algorithm to decide whether it should

Continue reading […] A bit more on recompilation in SQL Server […]