What are the challenges you face when working across database platforms? Take the survey

Bulk import error when deploying database using Use-DatabaseReleaseArtifact cmdlet

I have a project that needs to have certain static data seeded when deploying to a new database instance. 

Following the guidance at https://documentation.red-gate.com/sca3/developing-databases-using-sql-change-automation/generating-scripts-to-capture-database-changes/data-population/seed-data , I have added a bulk insert migration script, along with a CSV file containing the data and marked it as "Copy Always".

When I attempt to deploy the package using Use-DatabaseReleaseArtifact, I get a File not Found error when the bulk import migration is executed.

I have verified that the CSV file is packaged into the build artifact, and also is included in the release artifact.

I added the -debug flag to the UseDatabaseReleaseArtifact call so that I could verify the temp data location (under %localappdata%\temp\DLM Automation). Once the temp folder was created, I verified that the CSV file is present in the root of the temp folder.

The odd thing is that the temp folder's name does not match the folder reported in the error - for example, the deployment path is %localappdata%\Temp\DLM Automation\4fqzilj4.mg4\, but the error message shows that it's looking for the CSV file in %localappdata%\Temp\DLM Automation\o2jlg34q.bp3\, which does not exist.

Is there a reason for this discrepancy?

Best Answer


  • Options
    Hi Jack,

    Thanks for the information and workaround suggestion.  I'll be able to use the workaround during the development phase, but we'll definitely need to use the bulk insert strategy as we move towards production in the coming months.

    Just so I can plan ahead, is there a plan/timeline for when this bug might be fixed?
Sign In or Register to comment.