Quantcast
Channel: Forumul SQL Server Setup
Viewing all articles
Browse latest Browse all 7686

Batch file to backup SQL Server Express 2008 R2 Fails with Error 2

$
0
0

Here is the batch file that I am using:

cd "C:\Program Files\Microsoft SQL Server\100\Tools\Binn"
sqlcmd -S xxxxxxxx -d SQLEXPRESSAO12 -i "C:\Program Files\Microsoft SQL Server\AO12.sql" -U cga\administrator -P xxxxxxxxxxxx
pause

And here is the result:

Named Pipes Provider: Could not open a connection to SQL Server [2]...

I have checked the instance name a thousand times, I have made sure that there is read/write access to the folder and I have made sure that remote connections are allowed and that named pipes protocol is turned on.  I have also made sure that the SQLServer Service is running on the administrator account.

I got the script file from SSSM and it works just fine inside of SSSM, but here is the script file contents:

BACKUP DATABASE [GHA-AO] TO  DISK = N'C:\Program Files\Microsoft SQL Server\MSSQL10_50.SQLEXPRESSAO12\MSSQL\Backup\GHA-AO.bak' WITH NOFORMAT, NOINIT,  NAME = N'GHA-AO-Full Database Backup', SKIP, NOREWIND, NOUNLOAD,  STATS = 10
GO


Susan E. Russel



Viewing all articles
Browse latest Browse all 7686

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>