Fix Extended Properties difference highlighting
I use extended properties on all of my columns and tables. When I check in a table initially, these transfer fine.
If I edit the table and add a new column somewhere in the middle (i.e., anything other than the last ordinal position) and give that column an extended property, SQL Source Control correctly identifies the new column. However, down in the bottom pane when it compares the database version with the source control version, it incorrectly flags each and every extended property in an ordinal position after my new column as having changed.
Can this be modified so that extended properties in the database are compared to the extended property on the same column in source control, rather than just being compared to the extended property in that same ordinal position?
-
Anonymous commented
I fully agree, this is very annyoing - just have a look onto the attached screenshot (I just added a 4 columns (ok) plus their MS_Descriptions and the whole compare becomes an unreadable mess
maybe it would already help, if you change the syntax in your created scripts to
EXEC sys.sp_addextendedproperty @name = N'MS_DESCRIPTION', @level0type = N'SCHEMA', @level0name = N'schema', @level1type = N'TABLE', @level1name = N'table', @level2type = N'COLUMN', @level2name = N'column', @value = '<column description>' ;
(name the parameters and move the @value to the end of the line).Or use a logic similar to the logic for static data (there you are able to identify new / changed / deleted / equal rows). As primary key you could use the object_name + column_name (maybe not the id (except force column order is enabled), it is more likely that you have the the columns in the wrong order than that you rename columns).