Is there a way to compare programmatically in T-SQL the definitions of two tables.
Not only the column names and the data types, but all definitions that are returned by:
sp_help 'table_name'
Is there a way to compare programmatically in T-SQL the definitions of two tables.
Not only the column names and the data types, but all definitions that are returned by:
sp_help 'table_name'
1条答案
按热度按时间x6h2sr281#
I would say best practice is to install Visual Studio, make a database project, import a source database into it, and then compare target databases to the database project. (All in Visual Studio)
Then you can also put the database project in source control if you want.
It uses the Sql Server Schema compare. Using that alone could also be a solution.