How To Explicitly Connect SQL Server Using Specific ( Named Pipes / TCP / Shared Memory ) Protocol : Interview Question



 Many of us have all protocols enable in SQL server and I don't think if even couple of us notice which protocol we are using to connect to SQL server and if we have a requirement to connect to specific protocol.....


To connect SQL server first we have to make sure we should have enabled all 4 protocols in SQL configuration manager




Once we enable all protocols, we can open SQL server management studio and connect one by one with same server using protocols.

Here
SQL server instance name is "SAURABHTEST3". This is a default instance.


To connect to different protocols

  • Named Pipes :  NP: Servername
  • TCP \ IP :  TCP: Server Name 
  • Shared Memory : LCP: Server Name ; Localhost , (local) , ."dot"


To Connect using Named Pipes protocol:

To Connect using TCP / IP protocol:

To Connect using Shared Memory protocol:



As above shared memory can be connected on the same machine using localhost and other options.

After connection you can verify using sql
/****************************/
select session_id , net_transport
 from sys.dm_exec_connections
/****************************/
So once
SQL is connected it will be like


You might like to read: SQL Server architecture ( Interview )



1 comment:

  1. This blog is really good I would like to say thanks please share more content on MSBI Online Training

    ReplyDelete