We know basically when restarting the SQL server, it is basically means clearing Caches along with some other properties to get reset. But since our main Priority lies in Cleaning the Cache files, we can write a SQL script for doing this. SQL server has inbuilt function for clearing Cache Files. The main Cache files required to cleared during Restart is DATA CACHE and PROCEDURE CACHE. This effectively will restart your server. The Script for clearing these two caches are as follows: DBCC DROPCLEANBUFFERS ---- This will clear the data cache DBCC FREEPROCCACHE ---- This will clear the procedure cache Transact-SQL programming language provides DBCC statements that act as Database Console Commands for SQL Server.