troubleshooting Question

Disable named pipes with T-SQL

Avatar of Jim P.
Jim P.Flag for United States of America asked on
Microsoft SQL ServerMicrosoft SQL Server 2005Microsoft SQL Server 2008
6 Comments2 Solutions2370 ViewsLast Modified:
We have multiple hosted clients with each in there own little domain. I'm trying to setup a single DB server to catch reporting from the remote servers. I have to do it via IP.  I want to disable named pipes on the servers when I'm adding the logging script to the individual SQL Servers. Using the configuration GUI is just plain slow.

This is what I have currently to change the "Protocols for <InstanceName>" and the associated registry key.
EXEC master.dbo.xp_instance_regwrite N'HKEY_LOCAL_MACHINE', N'SOFTWARE\Microsoft\MSSQLServer\Client\SNI9.0', 
                               N'ProtocolsSupported', N'REG_MULTI_SZ', N'sm tcp';
GO
--------------------------------------------------------

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer\Client\SNI9.0]
"ProtocolsSupported"=hex(7):73,00,6d,00,00,00,74,00,63,00,70,00,00,00,6e,00,70,\
  00,00,00,76,00,69,00,61,00,00,00,00,00
"ProtocolOrder"=hex(7):73,00,6d,00,00,00,74,00,63,00,70,00,00,00,00,00
It is failing with  
-------------------------------------------------------------------------------------------------------
Error executing xp_regwrite extended stored procedure: Registry Type Invalid
-------------------------------------------------------------------------------------------------------

The other for SQL Native Client --> Client Protocols doesn't error, but the registry doesn't change either.
 
EXEC master.dbo.xp_instance_regwrite N'HKEY_LOCAL_MACHINE', 
                     N'SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL.1\MSSQLServer\SuperSocketNetLib\Np', 
                     N'Enabled', N'REG_DWORD', 0 ;
GO
--------------------------------------
[HKEY_LOCAL_MACHINE\ SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL.1\MSSQLServer\SuperSocketNetLib\Np]
"Enabled"=dword:00000000
"PipeName"="\\\\.\\pipe\\MSSQL$UNISON\\sql\\query"
"DisplayName"="Named Pipes"

The reg entries are what it should look like afterwards.

Any ideas?
ASKER CERTIFIED SOLUTION
Ryan McCauley
Senior Data Architect

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 2 Answers and 6 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros