Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Database backup of azure database deployed in local sql server management studio

Can anyone help me in doing this task? I am using my sql azure database in my local machine's sql server management studio 2008 r2. What my issue is, I am trying to take backup of a database from my c# console application using the following methods:

  • using smo: showing error at "sqlBackup(server)" method. The error details like -

    System.IndexOutOfRangeException: Index was outside the bounds of the array. at Microsoft.SqlServer.Management.Smo.SqlPropertyMetadataProvider.PropertyNam eToIDLookupWithException(String propertyName, PropertyAccessPurpose pap) at Microsoft.SqlServer.Management.Smo.SqlSmoObject.GetDbComparer(Boolean inSe rver) at Microsoft.SqlServer.Management.Smo.SqlSmoObject.InitializeStringComparer()

    at Microsoft.SqlServer.Management.Smo.AbstractCollectionBase.get_StringCompar er() at Microsoft.SqlServer.Management.Smo.SimpleObjectCollectionBase.InitInnerCol lection() at Microsoft.SqlServer.Management.Smo.SmoCollectionBase.InitializeChildCollec tion(Boolean refresh) at Microsoft.SqlServer.Management.Smo.SmoCollectionBase.GetEnumerator()

  • using "backup database" command, this showing command not supported in this version of sql server. After searching in internet, i found that this command wont support for azure databases in ssms. Can anyone please provide me solution to solve this.

like image 604
ajay kumar Avatar asked Jan 20 '26 15:01

ajay kumar


1 Answers

You can not backup the Database in Azure Sql Service. When try to Backup Shows this Error

Statement 'BACKUP DATABASE' is not supported in this version of SQL Server.

So Backup Azure SQL Service by Right Click on Db --> Tasks --> Export data Tier Application --> Set Location Creates a bacpac file after export, then it can be import via this

Note: Be aware there are export and extract. The extract option only copies the schema, so if you need the data as wel make sure to use the export variant.

like image 108
Sanjeev S Avatar answered Jan 23 '26 03:01

Sanjeev S