There is an unsaved comment in progress. You will lose your changes if you continue. Are you sure you want to reopen the work item?
Scripting whole DB, then running script on a new DB fails to create objects because of dependencies
I was trying to create a script to duplicate the DB schema on different DB.
The steps I followed were:
1) Created a source database for the exisitng database to be scripted
2) Created a new database that will be the target DB
3) Compare both databases and generated the script
4) Copied the script and ran it on the new DB to create the objects. It ran til the end, but there were many errors shown.
I researched the issues and found the problems were caused because of dependencies. ie. A view depending on another view failed because the dependency was not there when the script tried to create the main view. The dependency view was in the script but lines
below the main one.
The current version I am using is: 126.96.36.199
Hope this helps.