SQL SERVER – How to Kill All the Processes for Any Database?

Recently during Comprehensive Database Performance Health Check, to test our unique fix, we had to run a stress test on my customer’s development environment. Once we were done testing our script, we did not need our stress test queries to run on our server. Even though we stopped to run the batch file with stress test queries, there were few long-running queries kept on running on the server. This brought us to a very interesting point where we had to kill all the processes for one particular database.

Read More

SQL SERVER – 2008 – 2005 – Rebuild Every Index of All Tables of Database – Rebuild Index with FillFactor

I just wrote down following script very quickly for one of the project which I am working on. The requirement of the project was that every index existed in database should be rebuilt with fillfactor of  80. One common question I receive why fillfactor 80, answer is I just think…
Read More

SQL SERVER – Simple Use of Cursor to Print All Stored Procedures of Database

SQLAuthority Blog reader YordanGeorgiev has submitted very interesting SP, which uses cursor to generate text of all the Stored Procedure of current Database. This task can be done many ways, however, this is also interesting method. USE AdventureWorks GO DECLARE @procName VARCHAR(100) DECLARE @getprocName CURSOR SET @getprocName = CURSOR FOR SELECT s.name…
Read More

SQL SERVER – Guidelines and Coding Standards Complete List Download

Coding standards and guidelines are very important for any developer on the path to a successful career. A coding standard is a set of guidelines, rules and regulations on how to write code. Coding standards should be flexible enough or should take care of the situation where they should not prevent best practices for coding. They are basically the guidelines that one should follow for better understanding.

Read More