We want to keep the default values and bindings for VarChar fields on the SQL server.
Since BC26, SQL Server no longer automatically stores default values and bindings for VarChar fields in all cases.
Previously, these fields were always populated with an empty value based on the default settings.
This meant that, for example, when importing data from external systems, sometimes directly into SQL using INSERT commands, only the fields that were transferred needed to be populated. Now, all fields of the table must be specified in the INSERT command, making these operations significantly more complex.
Currently, the default values for the VarChar fields on the SQL server are not set for companies imported via PowerShell using the Import-NAVData command. Interestingly, these values are then set again for companies created from the imported companies via Business Central.
Original quote from Microsoft regarding this:
The distinction in behavior between Import-NavData and Copy company aligns with the product design. Default constraints are primarily implemented to facilitate rollback or uninstall scenarios for table extensions, rather than being universally applied. While historically more default constraints were created during company setup, this is no longer guaranteed and will be further minimized in future releases.
Currently, there are differences in SQL depending on which Microsoft function was used to create the companies. From a developer's perspective, I find this a disaster. I wish that all the different Microsoft functions for the same issue would produce the same result on the SQL server.
I would prefer to restore the state as it was before BC26, so that complexity in the SQL commands is avoided.
Microsoft should be aware that on-premises installations still exist and that tools outside of Business Central are used there. Just as Microsoft announces and documents changes to Business Central, it should also do so for changes that have an impact outside of Business Central like here on SQL Server.
