Tuning slow spatial queries in SQL Server

Even with the right indexes in place, spatial queries in SQL Server are often too slow – but they needn’t be. Two of the most commonly found patterns of query in the spatial world are when you’re looking for the nearest thing to where you are (which I’ve written about before), and when you’re looking … Continue reading Tuning slow spatial queries in SQL Server

SHOWPLAN permission denied even if the database isn’t actually used

To view a query plan, you need SHOWPLAN permission on the database level at least. You have this if you have CONTROL DATABASE, or CONTROL SERVER, or if you have ALTER TRACE at the instance level. I know this last one because it’s mentioned in Books Online on the ‘Database Permissions’ page, not because it’s … Continue reading SHOWPLAN permission denied even if the database isn’t actually used

T-SQL v MDX: Pick the hierarchy and populate the report parameter values

When dealing with report parameters, you want the experience to be as seamless as possible for the end user. In SQL Server Reporting Services, we have the tremendously useful feature of having dynamic parameters, in which you can set a particular report parameter based on the choice of a previous one. For example, if you … Continue reading T-SQL v MDX: Pick the hierarchy and populate the report parameter values