Blog Archives

Live Query Statistics – SQL Server 2016

SQL Server Management Studio (SSMS) 2016 has a handy new feature to View Live Query Statistics. This feature also works when connected to a 2014 instance using SSMS 2016. Why use it? Previously, similar stats were available by doing so:

Tagged with: , , , , , , , , , , , ,
Posted in Database, SQL Server

Export data from DocumentDB / CosmosDB to SQL Server

CosmosDB is Microsoft’s latest NoSQL database offering, a metamorphosed form of DocumentDB, so to speak. Read more about CosmosDB here. Here is a quick note on how to export data from CosmosDB to SQL and do data comparison. This is

Tagged with: , , , , , , , , , , , ,
Posted in CosmosDB, Database

Database Mail shutting down. Mail queue has been stopped.

DB mail in our production servers started acting up last week. We have SQL Server 2012 SP1. There were a couple of sets of symptoms. Following is what I did to get DB mail working again. I hope you don’t spend 4 hrs

Posted in Database, SQL Server


In 2005 version of SQL Server, XQuerying was introduced. It’s a powerful feature and when used together with a CTE, it helps to keep code simple and clean. I use XML extensively in my code and many a time, I

Tagged with: , , , , , , , ,
Posted in Database, SQL Server

Retrieve unsaved query

I was working on a remote machine and while I was away, the machine was restarted. Lost the scripts I had not saved, or so I thought; and then I came up with this – was a life saver!

Tagged with: , , , , , , , , ,
Posted in Database, SQL Server

Find tables which are most commonly used in Stored Procedures

When you start working on a new project, one of the important tasks as a database developer is to get used to the table names. Here’s a script which will help you identify the most commonly used tables (assuming that

Tagged with: , , , , ,
Posted in Database, SQL Server