Reputation: 3468
I have a database with 100 + tables and 50+ views. Each table got multiple columns with different type of possible constraints. I have a build x.1 as a baseline for above database. I need to know the way where I can generate the current DB structure in text file so that I can compare it with future DB structure to track the changes.
DB is SQL Server 2008 R2 I have SQL Server Management Studio to analyse it. I have tried using the option Task --> Generate Script and it gives me the sql script to generate database but I want output like all the table names and then each table structure in text format so that I can use tools like winmerge for comparison.
Upvotes: 1
Views: 2528
Reputation: 5909
Maybe it is worth considering a scheduled process that uses a schema comparison tool to check against a snapshot or a scripts folder in source control. Grant Fritchey has written an article that you could use as a basis for implementing this:
http://www.simple-talk.com/sql/database-administration/auditing-ddl-changes-in-sql-server-databases/
Upvotes: 0
Reputation: 31249
If you want to track changes in a database. I would consider changing tool. Here is a list of real good database compare tools:
My personal favorite is Apex sql. A really nice tool where you can do nice diffs and scripting databases to other versions.
Upvotes: 1