How to rebuild all indexes in MS SQL server database

In this post, I am gonna share a complete SQL snippet allowing to rebuild all indexes in the MS SQL server database quickly. You can use this complete SQL code directly in SQL Server Management Studio or your tool of choice. Rebuilding the indexes can heal index fragmentation and make a key difference when it comes to performance and database maintenance. Why…

How to delete a large number of records from MSSQL table

How to delete records from the MSSQL table page by page? In this short post, I am gonna share a quick SQL snippet allowing us to remove a lot of records from the MSQL table. Contrary to appearances, deleting a large amount of data from a SQL table may not be a simple task. It is good practice to avoid long-running…

Reset the identity column value in MSSQL

How to reset the identity column value in the SQL server? To reset the current identity value for the table you should use DBCC CHECKIDENT function. It’s a great way to control the numbers sequence for the identity column. DBCC CHECKIDENT function is very useful for database maintenance and can be applied to numeric types: smallint bigint tinyint numeric integer decimal Why should use…