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

谁说我不能喝 提交于 2019-12-04 03:20:15

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.

Client level protocols.

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.

Probably an unusual scenario but I just got this exception and tracked it down to an invalid database name in the Initial Catalogue value of the connection string.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!