SQL SERVER – Recycle Error Log – Create New Log file without Server Restart

The job of a consultant is always interesting – sometimes one becomes very busy and at times, over busy. I have been overwhelmed with recent performance tuning engagements. In one of the recent engagements, a large number of errors were found in the server. I noticed that their error log filled up very quickly. I also noticed a very interesting action by their DBA. I observed that after we make some changes in the server to avoid the errors, the DBA restarted the server. I asked him the reason for doing so. He explained every time that when he restarts the server, a new error log file is created. The current log file is renamed as errorlog.1; errorlog.1 becomes errorlog.2, and in a similar way, it continues. This way, after making some change, we can watch the error file from the beginning.

Read More

SQL SERVER – List of all the Views from Database

My earlier article SQL SERVER – The Limitations of the Views – Eleven and more… has lots of popularity and I have been asked many questions on the view. Many emails I received suggesting that they have hundreds of the view and now have no clue what is going on and how many of them have indexes and how many does not have an index. Some even asked me if there is any way they can get a list of the views with the property of Index along with it.

Read More

SQL SERVER – StreamInsight and SQL Server 2008 R2

SQL
SQL Server

I was recently called into create POC (Proof of Concept) for a project which was being planned for use StreamInsight. When I was there, I was also asked to give overview of the this feature to their CTO (who had only 15 minutes to spare). Usually I do not like sudden change of plans but the dynamic nature of consultation always gives me motivation to work more. I quickly talked few things in the session. In the evening, I had received the minutes of the meeting and had brief note regarding my discussion on StreamInsight. I am copy pasting the same brief note over here.

Read More

SQL SERVER – Find Total Number of Transactions on Interval

In one of my recent Performance Tuning assignment I was asked how do someone know how many transactions are happening on server during certain interval. I had handy script for the same. Following script displays transactions happened on server at the interval of one minute. You can change the WAITFOR DELAY to any other interval and it should work.

Read More