SQL Server v.Next (Denali) : Will you use EOMONTH()?

In Denali we have a new date-related function called EOMONTH() – it comes straight to us from VBA so many Excel and Access users will know exactly what it does. For those that don't, it returns the last day of the month for the date passed in, returning the same […]

Connect Digest : 2011-09-22

Where is SYSDATE()? I've talked about this one before, but due to a recent conversation about building a datetime value from separate date/time columns or variables, it may be worth bringing up again. When SQL Server 2008 introduced several new date/time types, they also added new built-in functions, like SYSDATETIME() […]

Want your bug fixed? File a good bug!

In some circles I'm known as "the Connect guy" because I've filed a heck of a lot of suggestions and bugs that I've envisioned or encountered, and I'm often willing to file an issue on someone else's behalf. In other circles, for very much the same reasons, I'm probably known […]

Bad Habits to Kick : Using EXEC() instead of sp_executesql

Today in my T-SQL: Bad Habits to Kick session at SQL Saturday #84 in Kalamazoo, a user asked if SQL Server supported anything like bind variables in Oracle when using dynamic SQL. When using dynamic SQL, you have two choices: EXEC() / EXECUTE(), or sp_executesql. Early on my career, I […]

Why generalizations are dangerous

A couple of years ago, John Sansom wrote a blog post comparing the performance of two different ways to get the maximum value from a column: MAX() and TOP (1). http://www.johnsansom.com/performance-comparison-of-select-top-1-verses-max/ In the conclusion, he states:  When a clustered index is present on the table & column that is to […]

A demo kit for SQL Sentry Plan Explorer

UPDATE 2016-10-07 – This demo kit has been overhauled: https://blogs.sentryone.com/aaronbertrand/plan-explorer-3-0-demo-kit/ Plan Explorer is a free application from SQL Sentry, designed to make execution plan analysis faster and easier. It was developed in response to customer demand for deeper query analysis, but was originally intended only for the paid version of the […]