I had a situation last week where I needed to find the MIN() and MAX() values of some data. Normally this would be pretty straightforward, but the problem was I needed to identify the MIN() and MAX() values amongst multiple columns. So today I bring you a SQL tip using APPLY. Looking at sys.procedures we … Continue reading Finding the Least and Greatest value over multiple columns.
It’s T-SQL Tuesday time again, and this month the host is Jens Vestergaard(t) whose topic of choice is The Essential SQL Server Tools in my stack Luckily for me, I started a Handy Tools blog series this year for the sole purpose of sharing all the amazing tools I use on a daily basis, so I was pleasantly surprised … Continue reading T-SQL Tuesday #101: Handy Tools
The next blog in my series of Handy Tools, I give you statisticsparser.com . Thank you, Richie Rump (t)! This awesome free tool allows you to take the output from statistic io, time and paste it into the web page. It will then parse all that information into a useful and more readable output and aggregate your reads, … Continue reading Handy Tool – Statistics Parser
Most SQL developers are familiar with using TOP(n) to return a desired number of results, but what if our ORDER BY column ends up having matching results, do we want to see them? If so, we can use WITH TIES in conjunction with TOP(n). "WITH TIES Used when you want to return two or more rows … Continue reading TOP(n) WITH TIES