Installing SQL Server on Windows? Don't Forget These 2 Useful Switches
In this article, see two helpful switches that help with installing SQL Server on Windows.
Join the DZone community and get the full member experience.Join For Free
A few days ago on Twitter, I wrote:
Couldn't connect to new SQL Server install because I forgot to enable TCP/IP. I'm the lead author for a Microsoft Press book about SQL Server administration.
Aside from demonstrating that checklists are helpful, it did raise an interesting point about why this isn't a configurable option in the SQL Server Setup tool. After all, most people using SQL Server today are not connecting to it locally on the same machine, and the Linux and Docker container versions of SQL Server already have TCP/IP enabled.
Thanks to some helpful responses from John Q. Martin (blog | Twitter) and Dave Dustin (Twitter) on that thread, it turns out (and I really should have known this, being a lead author on a book about SQL Server administration) that you can turn on TCP/IP as long as you install SQL Server from the command line or by using a configuration file.
You might also enjoy: Database Fundamentals #1: Install SQL Server
The two switches as outlined in the official documentation are:
TCPENABLED=1— enables TCP/IP
NPENABLED=0— disables Named Pipes
Did you just say to yourself that you don't install SQL Server on Windows using a configuration file? Do you click through every option and set it manually every time? Please don't do that. Use a configuration file instead.
Once you cross over to the automation side, you'll be able to do cool things like make sure all of your SQL Server deployments on Windows Server are the same, and now you can even ensure that TCP/IP is enabled by default, like me.
Thanks for the tip, John and Dave.
Share your thoughts in the comments.
Published at DZone with permission of Randolph West, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.