Cody Konior Senior SQL Server Database Administrator Spider photographer, stand-up comedian, astronomer, and occasional beekeeper.

SQL Server 2016 MDS upgrade errors

If you're doing an upgrade of the Master Data Services database to SQL 2016, there were some radical schema changes inside, and the upgrade may fail with an error:

Be careful if you've manually edited your SQLPS files

The SQLPS module has been slow to load for years now and has finally been fixed in the April 2016 release. But most of us couldn't wait a few years and edited the SqlPSPostscript.ps1 file that sits in the module directory.

Huntsman Spider

Huntsman Spider photo

Making SMO faster while avoiding an undocumented bug

Jon Sayce wrote an article in 2008 on how to improve SMO performance using the SetDefaultInitFields method on the Server object to pull back more than one property at a time; Diana Moldovan explored it a little further here. Unfortunately this setting can trigger a bug that cost me a few hours today.

Don't forget to reboot after installing SQL Server 2016 CTP 3.3

On a SQL 2016 CTP 3.2 server I was writing PowerShell scripts to bulk copy data into a database with simple ADO.NET classes. It was working perfectly fine to start with.

Wolf Spider

Wolf Spider photo

When a login looks fine but cannot log in

Updated 2016-02-09: This also applies when granting database-level permissions, not just roles. Added an example at the end. Also fixed up the final search procedure for servers with case-sensitive collations.

Sometimes after provisioning a login and user it cannot access a database even though everything looks fine, and it's inevitably caused by a missing connect permission on that database. I encountered the issue this week and after having a read of a post by Derek Hammer I wanted to test it for myself also.

Prowling Spider

Prowling Spider photo

Wolf Spider

Wolf Spider photo

Constructing a SQL Server 2016 temporal table using SMO

Temporal tables are arguably one of the coolest new features in 2016 that will finally put the nail into the coffin of homemade change tracking with triggers. Today I had to build one of these tables programmatically using SMO (SQL Server Management Objects) and could not find an existing demo; so I made one!

This is how to fix R Services after an in-place SQL Server 2016 CTP 3.2 upgrade

If you were using CTP 3.0 and later ran an in-place upgrade to CTP 3.2 this will silently break R Services. Uninstalling and reinstalling the R component will not fix the problem, but it can be fixed. There are a few interrelated issues here so bear with me.

Jumping Spider

Jumping Spider photo

Sac Spider

Sac Spider photo


Wasp photo

Cobweb Spider

Cobweb Spider photo

A few quick notes on SQL Server 2012 slipstreaming

SQL Server 2008 allowed you to slipstream service packs and cumulative updates into the installation media. In 2012 an additional and better method was created called "Product Updates" and (later) "Servicing Updates". PSS wrote a decent blog post introducing the feature.

Leaf Curling Spider

Leaf Curling Spider photo

Unidentified Spider

Unidentified Spider photo

Jumping Spider

Jumping Spider photo

Three cases where Ola Hallengren's Maintenance Solution won't backup a database

We love Ola Hallengren's Maintenance Solution but you should always always double-check either the msdb backup history or the master.dbo.CommandLog table to make sure any important backup was taken. This is especially important if you trigger it manually and are relying on human input to get the parameters right.

Here are three easy to miss cases where the scripts won't backup a database. These absolutely, definitely, aren't bugs, they're idiosyncrasies with the underlying backup command and (sometimes) how the script works. But they're also much easier to miss in the verbose output of the script.