Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
arkiboys
Master Smack Fu Yak Hacker
1433 Posts |
Posted - 2008-07-11 : 04:55:25
|
| Hi,In sql server configurations, named pipes (NP) is disabled and shared memory (SM) is enabled.using t-sql I am trying to find out whether or not they are enabled. See below...Problem:For NP, the returned field shows empty whereas it shows 'r' for SMQuestion:1)Does 'r' represent enabled and blank field represents Disabled?2)The code at the very buttom shows disabled for both returned data. Can you see why please?--code to get NP:--Named Pipes...Declare @valueNP as varchar(100)Set @valueNP = NULLExec master..xp_regread 'HKEY_LOCAL_MACHINE', 'SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL.1\MSSQLServer\SuperSocketNetLib\Np', 'Enabled', @valueNP OUTPUTselect @valueNP--code to get SM:--Shared Memory...Declare @valueSM as varchar(100)Set @valueSM = NULLExec master..xp_regread 'HKEY_LOCAL_MACHINE', 'SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL.1\MSSQLServer\SuperSocketNetLib\Sm', 'Enabled', @valueSM OUTPUTselect @valueSM--------------if (len(ltrim(rtrim(@valueNP))) > 0) select 'Enabled'else select 'Disabled'if (len(ltrim(rtrim(@valueSM))) > 0) select 'Enabled'else select 'Disabled' |
|
|
rmiao
Master Smack Fu Yak Hacker
7266 Posts |
Posted - 2008-07-11 : 23:57:45
|
| If enabled, the key is 1. Otherwise, it's 0. |
 |
|
|
arkiboys
Master Smack Fu Yak Hacker
1433 Posts |
Posted - 2008-07-14 : 05:38:08
|
| How do I modify the sql I am using so that I get 1 or 0?Thanks |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-07-14 : 05:48:11
|
Declare @valueNP as INTDeclare @valueSM as INT E 12°55'05.25"N 56°04'39.16" |
 |
|
|
arkiboys
Master Smack Fu Yak Hacker
1433 Posts |
Posted - 2008-07-14 : 05:52:37
|
| Thanks |
 |
|
|
|
|
|