How can we help you today? How can we help you today?

Database creation script

Hi:

Is it possible to create and maintain a sql script that faithfully recreates a database schema with SQL Compare version 6?

I have a script that creates a new database, from scratch, and replicates all the tables, indexes, constraints etc. The problem with this type of script is that the creation order is *very* important. For instance view 'B' can't be created before table 'A' if view 'B' acceses table 'A'.

Until now I have used Microsoft's SQL Server Management Studio, but I doesn't always get the creation order right!

Can I use SQL Compare 6 for this?

Thanks,
MartinH.
MartinH
0

Comments

2 comments

  • Michelle T
    The easiest way to create and maintain SQL script files and faithfully recreate a database schema with them is to maintain individual object script files and use SQL Compare 6 to synchronize them up to the live database. SQL Compare 6 will take care of getting the dependancies in the right order on synchronization to a live database.

    If you want the actual script which creates all the objects in the correct order, just compare the script files with an empty live database and save the resulting synchronization script.
    Michelle T
    0
  • MartinH
    Michelle:
    If you want the actual script which creates all the objects in the correct order, just compare the script files with an empty live database and save the resulting synchronization script.

    Thanks, I don't know why I didn't think of that!!

    Regards,
    Martin.
    MartinH
    0

Add comment

Please sign in to leave a comment.