{"id":252,"date":"2020-03-10T11:44:31","date_gmt":"2020-03-10T15:44:31","guid":{"rendered":"http:\/\/ericburdo.com\/blog\/?p=252"},"modified":"2020-03-10T11:45:11","modified_gmt":"2020-03-10T15:45:11","slug":"sql-server-aliasing-an-instance","status":"publish","type":"post","link":"http:\/\/ericburdo.com\/blog\/code\/252\/sql-server-aliasing-an-instance\/","title":{"rendered":"SQL Server &#8211; Aliasing an Instance"},"content":{"rendered":"\n<p>As you may know&#8230; I&#8217;m a software developer.  As with most developers, I want things to work&#8230; with minimal intervention.<\/p>\n\n\n\n<p>So, when I started a recent contract (.NET Core Web development), they were using a Git repository&#8230; I grabbed the latest, restored the DB backup to my local &#8220;full install&#8221; of SQL Server&#8230;<\/p>\n\n\n\n<p>AND BAM!  It didn&#8217;t work.  Why?  The current .config files all pointed to a .\\SQLExpress DB.  Yes&#8230; that&#8217;s a named instanced on localhost.<\/p>\n\n\n\n<p>Well, I didn&#8217;t want to reinstall SQL Server (which is the only way to change the Instance name).  And&#8230; I didn&#8217;t want to have to edit several .config files each time I pulled the latest changes.  And for various reasons, the client didn&#8217;t want to switch over to using a &#8220;connections.config&#8221; 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.)<\/p>\n\n\n\n<p>After a bunch of searching, I finally found someone else who had done what I wanted.<\/p>\n\n\n\n<p>Here is a link to the article &#8220;<a href=\"https:\/\/mariusschulz.com\/blog\/how-to-configure-a-sql-server-alias-for-a-named-instance-on-a-development-machine\">How to Configure a SQL Server Alias for a Named Instance on a\u00a0Development Machine<\/a>&#8220;.  For me, I had to make sure I did both 32 bit and 64 bit aliasing.<\/p>\n\n\n\n<p>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!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>As you may know&#8230; I&#8217;m a software developer. As with most developers, I want things to work&#8230; with minimal intervention. So, when I started a recent contract (.NET Core Web development), they were using a Git repository&#8230; I grabbed the latest, restored the DB backup to my local &#8220;full install&#8221; of SQL Server&#8230; AND BAM! [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[52],"tags":[76,105,104],"class_list":["post-252","post","type-post","status-publish","format-standard","hentry","category-code","tag-asp-net","tag-config-files","tag-sql-instance"],"_links":{"self":[{"href":"http:\/\/ericburdo.com\/blog\/wp-json\/wp\/v2\/posts\/252","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/ericburdo.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/ericburdo.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/ericburdo.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/ericburdo.com\/blog\/wp-json\/wp\/v2\/comments?post=252"}],"version-history":[{"count":2,"href":"http:\/\/ericburdo.com\/blog\/wp-json\/wp\/v2\/posts\/252\/revisions"}],"predecessor-version":[{"id":254,"href":"http:\/\/ericburdo.com\/blog\/wp-json\/wp\/v2\/posts\/252\/revisions\/254"}],"wp:attachment":[{"href":"http:\/\/ericburdo.com\/blog\/wp-json\/wp\/v2\/media?parent=252"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/ericburdo.com\/blog\/wp-json\/wp\/v2\/categories?post=252"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/ericburdo.com\/blog\/wp-json\/wp\/v2\/tags?post=252"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}