You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

将WideWorldImportersDW-Standard.bacpac导入Azure Data Studio 1.32时遇文件激活错误的技术求助

Fixing Bacpac Import Error for WideWorldImportersDW in Azure Data Studio

I’ve run into this exact issue before when importing bacpac files with custom filegroups—your error stems from SQL Server being unable to resolve or create the data file path specified in the bacpac’s deployment script. Let’s walk through actionable fixes step by step:

1. Manually Override Data/Log File Paths (Quickest Solution)

The Azure Data Studio wizard’s default variable substitution ($(DefaultDataPath), $(DefaultFilePrefix)) isn’t working as expected here. Here’s how to fix it:

  • Restart the Data-tier Application Wizard and proceed to the Database Settings step.
  • Expand the Filegroups section, then locate the USERDATA_B694BC2 entry under the USERDATA filegroup.
  • Replace the auto-generated FILENAME value (like $(DefaultDataPath)$(DefaultFilePrefix)_USERDATA_B694BC2.mdf) with a concrete, accessible path for your SQL Server instance. For example:
    C:\Program Files\Microsoft SQL Server\MSSQL15.MSSQLSERVER\MSSQL\DATA\WideWorldImportersDW_USERDATA_B694BC2.mdf
  • Repeat this adjustment for the corresponding .ldf log file entry under the same filegroup.
  • Complete the wizard and retry the import.

2. Verify SQL Server Service Account Permissions

If manual pathing doesn’t resolve the issue, your SQL Server service account might lack write access to the target directory:

  • Open Server Properties in Azure Data Studio (right-click your server → Properties).
  • Navigate to the Database Settings tab and note the default data/log paths.
  • Go to that folder in File Explorer, right-click → Properties → Security.
  • Add the SQL Server service account (usually NT SERVICE\MSSQLSERVER for default instances) and grant it Modify and Write permissions.
  • Restart the SQL Server service and try the import again.

3. Use sqlpackage.exe for Greater Control

The Azure Data Studio wizard can be finicky with variable substitution—using the command-line sqlpackage.exe tool often avoids these pitfalls:

  • Locate sqlpackage.exe (typically in C:\Program Files\Microsoft SQL Server\150\DAC\bin; adjust the version number to match your SQL Server installation).
  • Run this command, replacing placeholders with your actual paths:
    sqlpackage.exe /Action:Import ^
    /SourceFile:"C:\Your\Download\Path\WideWorldImportersDW-Standard.bacpac" ^
    /TargetConnectionString:"Server=.;Database=WideWorldImportersDW;Trusted_Connection=True;" ^
    /p:DefaultDataPath="C:\Program Files\Microsoft SQL Server\MSSQL15.MSSQLSERVER\MSSQL\DATA\" ^
    /p:DefaultLogPath="C:\Program Files\Microsoft SQL Server\MSSQL15.MSSQLSERVER\MSSQL\DATA\"
    
  • This forces explicit path substitution, bypassing the wizard’s variable handling issues.

4. Ensure the Bacpac File Is Uncorrupted

Occasionally, a partial or corrupted download can trigger this error:

  • Re-download the bacpac file to rule out corruption.
  • Verify integrity by opening the bacpac (it’s a ZIP file) and confirming the model.xml file inside is intact and contains valid filegroup configurations.

内容的提问来源于stack exchange,提问作者GlaceCelery

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.30 19:57:43