Backup-SqlDatabase: –ServerInstance parameter error - by Ana Mihalj

Status : 

  By Design<br /><br />
		The product team believes this item works according to its intended design.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.

Sign in
to vote
ID 772895 Comments
Status Closed Workarounds
Type Bug Repros 0
Opened 11/30/2012 1:32:39 AM
Access Restriction Public


On Windows 7 I have installed SQL Server 2008 R2 (default instance - 10.50.2500.0) and SQL Server 2012 (named instance - 10.50.2500.0).

Backup-SqlDatabase with parameter –ServerInstance returns error (for both versions):

Backup-SqlDatabase : Failed to connect to server SQL2008R2\DEFAULT.
At line:1 char:1
+ Backup-SqlDatabase -ServerInstance SQL2008R2\DEFAULT -Database model
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Backup-SqlDatabase], ConnectionFailureException
    + FullyQualifiedErrorId : Microsoft.SqlServer.Management.Common.ConnectionFailureException,Microsoft.Sql 

Backup-SqlDatabase with parameters -Path works correctly:
Backup-SqlDatabase -Path "SQLSERVER:\SQL\SQL2008R2\DEFAULT" -Database model

This also works correctly:
Backup-SqlDatabase -Database model
Sign in to post a comment.
Posted by Microsoft on 10/11/2013 at 7:29 AM
Let us know if this approach worked for you

Sethu srinivasan [MSFT]
SQL Server
Posted by Ana Mihalj on 12/3/2012 at 11:54 PM
Thank you Sethu.
Posted by Sethu Srinivasan on 12/3/2012 at 10:08 AM
To connect to default instance, you don't need to specify "DEFAULT" in ServerInstance parameter

Following example backs up model database on default instance on local machine

backup-sqldatabase -serverinstance $ENV:ComputerName -Database model

Sethu Srinivasan [MSFT]
SQL Server