SQL Server DBA Tutorial 59 - How to find SQL Server Port Number using SQL Server Management Studio

preview_player
Показать описание
*****************************************************************************************
* How to find SQL Server Port Number using SQL Server Management Studio *
*****************************************************************************************

Learning :
- How to read Registry values using T-SQL Script

********** script start here ********
-- How to find the servicename--

-- Method 1: --
DECLARE @PortNumber VARCHAR(10), @KeyValue VARCHAR(100)
BEGIN
END
ELSE
BEGIN
SET @keyValue = 'SOFTWARE\MICROSOFT\MSSQLServer\MSSQLServer \Supersocketnetlib\TCP'
END
--How to read Registry in T-SQL Terms - ROOTKEY, KEY, VALUENAME,VALUE

-- Method 2:--
---You get the detail of the SQL Server port on which current SQL Server instance is configured.--
EXEC xp_ReadErrorLog 0, 1, N'Server is listening on', N'any', NULL, NULL, 'DESC'
GO

-- Method 3 --
DECLARE @portNumber NVARCHAR(10);
EXEC xp_instance_regread
@rootkey = 'HKEY_LOCAL_MACHINE',
@key = 'Software\Microsoft\Microsoft SQL Server\MSSQLServer\SuperSocketNetLib\Tcp\IpAll',
@value_name = 'TcpDynamicPorts',
@value = @portNumber OUTPUT;
SELECT [Port Number] = @portNumber;
GO

********** script end here ********

Note : Flow the Process shown in video.

😉Subscribe and like for more videos:
💛Don't forget to, 💘Follow, 💝Like, 💖Share 💙&, Comment

Tutorial Link :

Thanks & Regards,
Chitt Ranjan Mahto "Chirag"
_________________________________________________________________________________________
Note: All scripts used in this demo will be available in our website.
Link will be available in description.

#dbatutorial
#DBATutorialLearning
#DBAEducation
#DBATutorialFree
#DatabaseTutorial
#SQLServerDatabaseTutorial
#SQLServerDBATutorial
#MicrosoftSQLServerDatabaseTutorial
#ChiragsDBATutorial
#ChiragsDatabaseTutorial
#ChiragsSQLServerDatabaseTutorial
#ChiragsSQLServerDBATutorial
#ChiragsMicrosoftSQLServerDatabaseTutorial
#CreateDatabaseinSQLServer
#CreateDatabasewithT-SQL
#sql
#sqlserver
#sqlservertutorial
Рекомендации по теме