0

We are using Visual Sutdio Data-tier Application, a.k.a. SQL Server Database Project, to control the SQL source code of our database, including the table definitions.

As an example, we are making changes as shown in the following screenshot of Visual Sutdio's "SQL Schema Compare". DDL changes shown by SQL Schema Compare

When we click on the "Update" button to import the changes, Visual Studio will do cosmetic adjustments to the vertical alignment of the source code, as a result, the unchanged lines appear different in the text diff of Git because of the additional whitespace. See the following screenshot for Git's text diff.

diff --git a/mssql-project/schema/Tables/sales_order.sql b/mssql-project/schema/Tables/sales_order.sql
index 7c22249..25a1b75 100644
--- a/mssql-project/schema/Tables/sales_order.sql
+++ b/mssql-project/schema/Tables/sales_order.sql
@@ -1,172 +1,304 @@
 CREATE TABLE [schema].[sales_order] (
-    [entity_id]                                 BIGINT          IDENTITY (2956088, 1) NOT NULL,
-    [state]                                     NVARCHAR (32)   DEFAULT (NULL) NULL,
-    [status]                                    NVARCHAR (32)   DEFAULT (NULL) NULL,
-    [coupon_code]                               NVARCHAR (255)  DEFAULT (NULL) NULL,
-    [protect_code]                              NVARCHAR (255)  DEFAULT (NULL) NULL,
-    [shipping_description]                      NVARCHAR (255)  DEFAULT (NULL) NULL,
-    [is_virtual]                                INT             DEFAULT (NULL) NULL,
-    [store_id]                                  INT             DEFAULT (NULL) NULL,
-    [customer_id]                               BIGINT          DEFAULT (NULL) NULL,
...
+    [entity_id]                                    BIGINT          IDENTITY (8191339, 1) NOT NULL,
+    [state]                                        NVARCHAR (32)   DEFAULT (NULL) NULL,
+    [status]                                       NVARCHAR (32)   DEFAULT (NULL) NULL,
+    [coupon_code]                                  NVARCHAR (255)  DEFAULT (NULL) NULL,
+    [protect_code]                                 NVARCHAR (255)  DEFAULT (NULL) NULL,
+    [shipping_description]                         NVARCHAR (255)  DEFAULT (NULL) NULL,
+    [is_virtual]                                   INT             DEFAULT (NULL) NULL,
+    [store_id]                                     INT             DEFAULT (NULL) NULL,
+    [customer_id]                                  BIGINT          DEFAULT (NULL) NULL,
...

We wonder how to overcome the additonal whitespace, and let the text diff show more meaning results.

1

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.