As you may know… I’m a software developer. As with most developers, I want things to work… with minimal intervention.
So, when I started a recent contract (.NET Core Web development), they were using a Git repository… I grabbed the latest, restored the DB backup to my local “full install” of SQL Server…
AND BAM! It didn’t work. Why? The current .config files all pointed to a .\SQLExpress DB. Yes… that’s a named instanced on localhost.
Well, I didn’t want to reinstall SQL Server (which is the only way to change the Instance name). And… I didn’t want to have to edit several .config files each time I pulled the latest changes. And for various reasons, the client didn’t want to switch over to using a “connections.config” file to remove the connection strings from the web.configs. (That would have been best, since I could then just git ignore the connections file, and continue working.)
After a bunch of searching, I finally found someone else who had done what I wanted.
Here is a link to the article “How to Configure a SQL Server Alias for a Named Instance on a Development Machine“. For me, I had to make sure I did both 32 bit and 64 bit aliasing.
TADA! I can now leave the .config files alone, and my local install of the DB (that uses the MSSQLServer instance naming) happily works with a connection string pointing at .\SQLExpress!