Skip to content

✨ Drop all views with _SHARING in their name before creating .bacpac on T1 environment #731

@FH-Inway

Description

@FH-Inway

According to https://www.yammer.com/dynamicsaxfeedbackprograms/threads/2228926546395136, when a database sync is executed on a sandbox (T2+) environment (probably as part of a deployable package deployment), a field SYSSHARINGDATAAREAID is added to multiple tables and views are created with that field (e.g. VENDLEDGER_SHARINGVIEW).

When the sandbox database is then exported and imported to a T1 environment, the fields are removed from the tables, but the views with the now invalid field remain.

This causes an error when a .bacpac is exported from the T1 environment.

A workaround described in the Yammer thread is to drop the views before exporting the .bacpac. The views get recreated when the .bacpac is restored on a T2+ environment.

This could be accomplished with the -CustomSqlFile parameter of New-D365Bacpac. To make this more user friendly, we should consider adding the dropping of views with _SHARING in their name to Clear-SqlBacpacDatabase.sql, which gets called by New-D365Bacpac via the internal function Invoke-ClearSqlSpecificObjects

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions