Month: April 2017

Code more for me than you. Backup a database and restore it to an availability group (picks the AG that has the least number of databases). If the server isn’t clustered or doesn’t have HADR enabled, just restores it. Not thoroughly tested.

Admittedly, I don’t know that much about this, I just started fooling around with this tonight (via this post). As stated in said post, this works for only under x86 and AFAIK, needs at least Sql Server 2014 (I couldn’t find the required dll’s under sql 2012…). Edit 20170410: The 64 bit dll’s are located in ‘C:\Program Files\Microsoft SQL Server\120\Shared’ for sql server 2014. I’m assuming they’re in the 130 directory for Sql Server 2016.