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



Explicitly Connect SQL Server 

Named Pipes / TCP / Shared Memory 


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 requirement to connect to specific protocol.....
Frequently Used Queries In SQL Server

To connect SQL server first we have to make sure we should have enable 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


  1. Named Pipes :  NP: Servername
  2. TCP \ IP :  TCP: Server Name 
  3. 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 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 )





No comments:
Write comments

Please do not enter spam links

Meet US

Services

More Services