One thing that I end up having to look search on regularly is rounding of dates and times in Transact SQL, having looked this up too many times I finally realized that it is time for me to do my own blog post for it. First off, whats the difference between rounding and truncating in these examples. Rounding rounds to …

TSQL Rounding or Truncating DateTime to Nearest Day, Hour, Minute or Second Read more »

Coming in the next beta of the Database Health Report is a new feature called the Historic Reports which installs a small database to track database statistics over time.  This has an extremely light load on the overall database performance, and will allow you to track down details of why the database was slow at a specific point in time. …

Database Health Reports – Historic Waits Report Sneak Preview Read more »

Have you ever needed to generate a list of dates for the last 30 days.  There are lots of different ways to do this with TSQL, but one way is with a CTE, where you can then left join against it with another query to generate a list of all  dates in a result set, along with the dates for …

Recursive CTE to Calculate Dates for the Last 30 Days Read more »

There are so many cool tools available today for data visualization.   This posting covers pulling data from the AdventureWorks2012 database running on SQL Server 2012, and then using the Google Visualization tools to display geographic data. The final outcome will the this map. People in the AdventureWorks2012 database. Here is how I did it. Step 1: Create a query …

Adventureworks2012 data to Google GeoChart Visualization Read more »

I just found out that two of the sessions that I proposed for SQL Saturday #166 in Olympia next month have been accepted.  These presentations are: Exploring TSQL Enhancements in SQL Server 2012 Unleashing Common Table Expressions in SQL Server These are both presentations that I have given before and have had lots of fun with.   This should be a good …

2 Sessions Accepted for SQL Saturday 166 in Olympia Next Month. Read more »

Now that Beta 2 of the Database Health Project is out, and people are using it, I am going to focus my attention on 2 areas. Fixing any bugs that are reported in Beta 2 of the Database Health Project. Adding new features, specifically related to offline monitoring or history data. Currently all of the reports in the database health project …

Now that Database Health Beta 2 is out, whats next… Read more »

I often get asked “how do I find the contents of the SQL Server Plan Cache?”   My first response is just use the Database Health Reports and you can get this through a nice user interface.  But if you still want to get at the Plan Cache contents, I use the following query. Again, the Database Health Reportsgives you a …

Finding the contents of the Plan Cache Read more »