We have a SQL Server database deployed out into multiple environments. Usually when we export the data out using Tasks --> Generate Scripts the dependency order is maintained and the resulting script can be run into a fresh database with the same schema.
On one particular database this is not happening. The dependency order is wrong and the resulting scripts fails.
The databases were all created the same way and in all instances we are following the same process to export the data:
- Right-click database and go to Tasks --> Generate Scripts
- Select specific database objects -> Select tables (always the same set)
- Select Advanced --> Type of data to export = Data Only
Have checked the options in SSMS --> Tools --> Options --> SQL Server Object Explorer --> Scripting and they match between environments.
Is there anything else that could cause the order to be wrong? We have this running fine on multiple versions. The one that fails is 2014 SP3.