SQL SERVER – Creating Temporary and Global Temporary Stored Procedures

During recent Comprehensive Database Performance Health Check, I had a very interesting situation I encountered where we found a stored procedure which was a root cause of the slowness. What we needed to do is to change the code and test if our new stored procedure is better than previous stored procedure or not. One of the options was to create a new stored procedure by renaming the older stored procedure and keep on testing. However, there was a small risk if we forget to drop the newly created stored procedure there will be junk created in the database. Let us see how we can avoid this situation by creating temporary or global Temporary stored procedures.

Read More

SQL SERVER – xp_cmdshell and Net Use ERROR: The Local Device Name is Already in Use

People generally ask me; how do I manage to find a blog topic for every day blogging? And my answer is – “Connect yourself to the ground, try to help people with the basics, have open eyes & ears and promise yourself to learn one new thing every day”. If one can achieve these, every day blogging is easier. As a part of my consulting, I was helping a client to run some scripts and while testing, I learned something new. In this blog, we would learn about cause and solution of the error, the local device name is already in use.

Read More

SQL SERVER – How to Find Stored Procedure Execution Count and Average Elapsed Time?

Every single time when I go for Comprehensive Database Performance Health Check, I get many different questions from the users. However, there are some questions which are very common and I have started to build a list of the such questions so I can share the same with you. Today’s question is about the Stored Procedure Execution Count.

Read More