Enable TCP/IP Protocol in SQL Server Configuration Manager Using Command Prompt

Enable TCP/IP Protocol in SQL Server Configuration Manager Using Command Prompt

Hi friends, in this tutorial we will explain how to Enable TCP/IP Protocol in SQL Server Configuration Manager Using Command Prompt. Here we are not using GUI. This question is asked by one of my friend in a interview.

First of all open command prompt then go to C:\ drive root. Then copy below mention script for enable or disable TCP\IP or Named Pipes in SQL Server.

In previous post we have explained How to Configure User to Create and Manage SQL Server Agent JobsFind Fragmentation Level by using Command Prompt SQL ServerSQL Server Interview Questions & Answers 3SQL Server Delete Duplicate Rows and How to Connect MySQL Database in Asp.Net using C#.

Script:

——TO DISABLE TCP\IP ——–

WMIC /NAMESPACE:\\root\Microsoft\SqlServer\ComputerManagement10 PATH ServerNetworkProtocol Where ProtocolName=’Tcp’ CALL SetDisable

—-TO DISABLE NAMED PIPES—–

WMIC /NAMESPACE:\\root\Microsoft\SqlServer\ComputerManagement10 PATH ServerNetworkProtocol Where ProtocolName=’Np’ CALL SetDisable

—–TO ENABLE TCP\IP —–

WMIC /NAMESPACE:\\root\Microsoft\SqlServer\ComputerManagement10 PATH ServerNetworkProtocol Where ProtocolName=’Tcp’ CALL SetEnable

—–TO ENABLE NAMED PIPES—–

WMIC /NAMESPACE:\\root\Microsoft\SqlServer\ComputerManagement10 PATH ServerNetworkProtocol Where ProtocolName=’Np’ CALL SetEnable