Downgrade a SQL Server 2014 database to SQL Server 2012 or below

After an almost catastrophic 48 hour downtime with my existing hosting provider I decided to move my business, which involved moving a number of websites and their corresponding databases to my new hosting provider.

Now, the thing that I liked about my existing provider was that they supported SQL Server 2014.  My new one doesn’t (and neither do a LOT of providers for some reason), so this meant having to downgrade my databases from SQL Server 2014 to SQL Server 2012. Continue reading

How to target SQL Server 2014 from a Visual Studio 2013 SQL Server Database Project

I’ve just installed SQL Server 2014 and want to check what might break in my current SQL Server 2008 database when I upgrade it.

Thomas LaRock has written a great article providing a list of a dozen things to check before upgrading and I would definitely suggest making this your first port of call if you’re planning an upgrade.  Continue reading

Managing Static Data in a SQL Server Visual Studio Project

I’m a fan of the SQL Server project type that ships with Visual Studio having used it over the years with a number of projects.  I’ve been away from it for a couple of years though having been working with a company that preferred Redgate’s SQL Source Control offering, so coming back to SQL Server projects again my memory’s been a bit hazy and I’ve struggled how to remember to do some things.

One of these things was how to manage static data Continue reading

Aliases in SQL Server 2008

As far as I’m concerned remembering server names is a pain in the backside especially when you have no control over how they are named.  Is abc123.sql.domain.net the development environment, or is it the UAT environment, or is it production?

The good news is that you can set up aliases in SQL Server 2008 to help you out and it literally only takes a couple of minutes to do. Continue reading

Remove Recent Server List in SQL Server 2008

Having recently gone through the process of moving a number of databases to new servers I was met with the annoying issue of having my list of recent servers in SQL Server 2008 being cluttered with servers that were no longer active.  Although you can’t clear this list directly through the SQL Server GUI (apparently this is possible in SQL Server 2012) it is straight forward enough to get rid of your unwanted servers.

Before you start though, make sure all instances of SQL Server are closed. Continue reading

SQL Server SYNONYM

I’ve recently been working on an application which has to make use of data from within two databases (one onsite and one remote) with SQL generated to query the two databases along the lines of:

SELECT a.*, b.*
FROM [TableA] a
INNER JOIN [DatabaseB].[SchemaB].[TableB] b ON a.ID = b.ID

Referencing the second database using its full name is annoying to type but also limiting.  Imagine if you were working on a couple of projects, each of which used the same version DatabaseA, but which needed to reference different versions of DatabaseB.  If you were developing each of these databases in SQL Server you’d have to call the second version of DatabaseB something different which would end up breaking your SQL as it specifically references DatabaseB by name. Continue reading