Each of our clients has a database with their own data. Each database should have exactly the same structure. How can I find columns whose datatype has been changed, where the table name and column name is the same but the datatype is not? Is there an SQL query that can do this?
Share
If both databases can be restored to the same server, you can compare the two sets of system catalog views to determine the differences:
Of course, you can add more columns from the
sys.columnscatalog view, e.g.precisionandscalefor types likeDECIMAL(18,2), ormax_lengthfor string-based types (likeVARCHAR(50)etc.) – adapt this base query as needed