Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sql Exception: No Process Is on the Other End of the Pipe

I can not access my sql server connection from c# code. I get this error:

Sql Exception: No Process Is on the Other End of the Pipe

thats the connection string in my app.config:

<add name="DefaultConnection" providerName="System.Data.SqlClient" connectionString="Data Source=BELLA\SQLEXPRESS;Initial Catalog=TLP;User Id=pascal;Password=test;Pooling=False"/>

When I use windows authentication: Integrated Security=True;

Then I can connect to the database.

BUT I can NOT use windows authentication because the opening of the sql connection is done from within a windows service which is run as LocalSystem. When I do this I get this error:

Login failed. Login failed for user 'NT AUTHORITY\SYSTEM'

Its the first time I create a login + user in sql management studio so I am nearly sure I did something wrong and its my fault.

This is what I did:

1) Create a new login in the server`s security folder with sql authentication user:pascal and password:test.

2) Went to my database and create a new user in the security folder with user: pascal and login: pascal and schema: dbo

3) Did I forget something?

Solutions from other people:

1) I have also tried this link but no luck my Sql Select on the suspect_pages table is empty.

Error: No process is on the other end of the pipe

2) My Sql Server network configuration has ENABLED on the tcp/ip, names pipes and shared memory settings.

3) SQL Server 2008 can't login with newly created user

Number 1 to 3 did not help at all.

All this is done on my local machine. No network is here.

like image 332
Pascal Avatar asked Jan 25 '14 15:01

Pascal


People also ask

How do I enable TCP IP connection in SQL Configuration Manager?

On the Start menu, click All Programs > Microsoft SQL Server 2012 > Configuration Tools > SQL Server Configuration Manager. Click SQL Server 2012 Services. Expand the SQL Server 2012 Network Configuration node, and then select Protocols for MSSQLServer (SQL Instance Name) . Right-click TCP/IP, and then click Enable.

What is “no process is on the other end of the pipe”?

Resolving “No Process is on the Other End of the Pipe” Error in SQL Server. While connecting to SQL Server 2008, you may encounter the error “Named Pipes Provider: No process is on the other end of the pipe.” A common reason for this error is possibly that named pipes are not enabled on your server or the Named Pipes protocol is listed...

How to enable named pipes protocol in MS SQL Server?

Step 1. Run MS SQL Server. Step 2. Go to configuration tools, and then open "SQL Server Network Configuration" in SQL Server Configuration Manager. Step 3. Launch the Properties windows of Named Pipes Protocol then click "Enable". Step 4. Click "Apply" and "OK" to apply this change on SQL Server.

How to fix named pipes not enabled on the server?

If the client protocol order is attempting to connect with the named pipes protocol before trying the TCP protocol, and named pipes are not enabled on the server, solve this problem by following this: Using SQL Server Configuration Manager on the client computer, move TCP before named pipes in the protocol order list.

Why is MY SQL Server not connecting to the server?

The reason why you got this error is that the user connections was reset to 1, so only one user was able to connect with the SQL server.


1 Answers

Did you enable Shared Memory and TCP/IP providers in SQL configuration?

If not, try opening the SQL Server Configuration Manager utility and enabling Shared Memory and TCP/IP. The order that works for me is Shared Memory (1) and TCP/IP (2) for both server and client.

Also, make sure you are creating both a SQL LOGIN and DATABASE USER for PASCAL with correct rights.

Check out my blog article on creating logins. http://craftydba.com/?p=656

The snippet below will blow away and recreate your login/user with the correct default database, default schema and read/write privileges.

-- Which database to use.
USE [TLP]
GO

-- Delete existing user.
IF  EXISTS (SELECT * FROM sys.database_principals WHERE name = N'pascal')
DROP USER [pascal]
GO

-- Which database to use.
USE [master]
GO


-- Delete existing login.
IF  EXISTS (SELECT * FROM sys.server_principals WHERE name = N'pascal')
DROP LOGIN [pascal]
GO

-- Add new login.
CREATE LOGIN [pascal] WITH PASSWORD=N'test', DEFAULT_DATABASE=[TLP]
GO

-- Which database to use.
USE [TLP]
GO

-- Add new user.
CREATE USER [pascal] FOR LOGIN [pascal] WITH DEFAULT_SCHEMA=[dbo]
GO

-- Add to database read / write roles
EXEC sp_addrolemember 'db_datareader', 'pascal'
EXEC sp_addrolemember 'db_datawriter', 'pascal'
GO

-- Add to database owner role?  
-- Only give out if application needs a high level of privileges.
-- EXEC sp_addrolemember 'db_owner', 'pascal'
-- GO

Server level protocols.

enter image description here

Client level protocols.

enter image description here

I never choose NETBIOS since it is a non-routable protocol.

If you are still having issues, please post a screen shot and more details.

like image 131
CRAFTY DBA Avatar answered Sep 17 '22 15:09

CRAFTY DBA