SQL Azure BACPAC extraction

后端 未结 1 898
一向
一向 2021-01-06 14:26

How to programmatically (C#) extract a BACPAC file from a SQL Azure Database?

I was thinking in terms of creating a azure job to extract this bacpack file and save i

相关标签:
1条回答
  • 2021-01-06 15:04

    Add microsoft.sqlserver.dac.dll

    SqlConnectionStringBuilder csb = new SqlConnectionStringBuilder();
    csb.DataSource = "servername";
    csb.Password = "whatever";
    csb.UserID = "whatever";
    
    DacServices ds = new DacServices(csb.ConnectionString);
    ds.ExportBacpac(@"C:\backup\backup.bacpac");
    
    0 讨论(0)
提交回复
热议问题