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 requirement to connect to specific protocol.....

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 protoclos.

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 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



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













No comments:
Write comments

Please do not enter spam links

Meet US

Services

More Services