Extra parentheses around table default values

JasonRJasonR Posts: 8
For reasons that I do not understand, SSC3 will show uncommitted changes for tables that have not been altered. When reviewed, it appears that the source controlled version of each table includes an extra set of parentheses around any value specified as a default value any value used in a constraint for a field. In addition, "WITH NO CHECK" has been added in front of "ADD CONSTRAINT" wherever it appears.

Any ideas on why this is happening?

Examples below:

Database
[CheckedFlag] [bit] NOT NULL CONSTRAINT [DF_tblAnnualPerformanceHistory_CheckedFlag] DEFAULT (0),
...
ALTER TABLE [dbo].[tblAnnualPerformanceHistory] WITH NOCHECK ADD CONSTRAINT [CK_tblAnnualPerformanceHistory] CHECK (([PerfYear] >= 1900 and [PerfYear] <= 2200))

Latest source control version
[CheckedFlag] [bit] NOT NULL CONSTRAINT [DF_tblAnnualPerformanceHistory_CheckedFlag] DEFAULT ((0)),
...
ALTER TABLE [dbo].[tblAnnualPerformanceHistory] WITH NOCHECK ADD CONSTRAINT [CK_tblAnnualPerformanceHistory] CHECK (([PerfYear]>=(1900) AND [PerfYear]<=(2200)))

Note that we're using the "shared" database development model.

Comments

  • csmithcsmith Posts: 138 Bronze 1
    Hi

    We think the issue may be that SQL Source Control has not correctly picked-up the compatibility level of your datbase.

    Could you please let us know a couple of pieces of information to help us confirm this?

    1. What version of SQL Server is the database running on (2005, 2008, 2008 R2)?
    2. What is the Combatibility Level for the db you are source controlling? To find out, go to the Database Properties dialog for the db and select the Options section.
    3. What is the database version listed in the RedGateDatabaseInfo.xml file stored in your repository? This file is stored in the "Schema" folder SQL Source Control has created in your version control system.

    Thanks,
    Chris
    Divisional Development Lead
    Redgate Software
  • Thanks for looking into this.

    1. SQL Server Version: 2008 (v10.0.5500)
    2. Compatibility Level: SQL Server 2008 (100)
    3. Database version in XML file: 10
  • csmithcsmith Posts: 138 Bronze 1
    Hi

    Thanks for that. Unfortunately, that does not point to a Compatibility Level problem and we can't recreate your issue yet.

    Can you please send us the entire 'database' and 'latest source control' scripts for your example below?

    Also, if you have SQL Compare v10, would you be able to do a comparison between your source control repository and your database to see if the parentheses difference shows up there too?

    Thanks
    Chris
    Divisional Development Lead
    Redgate Software
  • Unfortunately, I had already used "undo" on the differences shown in my original example. I'll post the full scripts when the issue crops up again (it's happened to us more than once, so I'm assuming it might happen again).
  • Okay--the problem came back and affected the very same tables.

    I ran a comparison using SQL Compare v10 and the differences appear there as well. Full scripts below.

    I should also note that I've been using SQL Data Compare v9 to occasionally refresh the data in the development database with production data. Maybe it's doing something to the constraints?

    Database
    -- Columns
    
    CREATE TABLE [dbo].[tblAnnualPerformanceHistory]
    (
    [AnnualPerformanceHistoryID] [int] NOT NULL IDENTITY(1, 1) NOT FOR REPLICATION,
    [FundID] [int] NOT NULL CONSTRAINT [DF__Temporary__FundI__7720AD13] DEFAULT (0),
    [PerfYear] [smallint] NOT NULL,
    [Performance] [float] NULL,
    [EstimateFlag] [bit] NOT NULL CONSTRAINT [DF_tblAnnualPerformanceHistory_EstimateFlag] DEFAULT (0),
    [GrossFlag] [bit] NOT NULL CONSTRAINT [DF_tblAnnualPerformanceHistory_GrossFlag] DEFAULT (0),
    [CheckedFlag] [bit] NOT NULL CONSTRAINT [DF_tblAnnualPerformanceHistory_CheckedFlag] DEFAULT (0),
    [PerformanceSourceID] [int] NOT NULL CONSTRAINT [DF_tblAnnualPerformanceHistory_SourceID] DEFAULT ((1)),
    [DateEntered] [smalldatetime] NULL CONSTRAINT [DF_tblAnnualPerformanceHistory_DateEntered] DEFAULT (getdate())
    ) ON [PRIMARY]
    GO
    -- Triggers
    
    CREATE TRIGGER [dbo].[tblAnnualPerformanceHist_ITrig] ON [dbo].[tblAnnualPerformanceHistory] FOR INSERT AS
    SET NOCOUNT ON
    /* * VALIDATION RULE FOR FIELD 'PerfYear' */
    IF (SELECT Count(*) FROM inserted WHERE NOT (PerfYear>1900 And PerfYear<2999)) > 0
        BEGIN
            RAISERROR 44444 'You must enter a year betwen 1900 and 2999!'
            ROLLBACK TRANSACTION
        END
    GO
    CREATE TRIGGER [dbo].[tblAnnualPerformanceHist_UTrig] ON [dbo].[tblAnnualPerformanceHistory] FOR UPDATE AS
    SET NOCOUNT ON
    /* * VALIDATION RULE FOR FIELD 'PerfYear' */
    IF (SELECT Count(*) FROM inserted WHERE NOT (PerfYear>1900 And PerfYear<2999)) > 0
        BEGIN
            RAISERROR 44444 'You must enter a year betwen 1900 and 2999!'
            ROLLBACK TRANSACTION
        END
    GO
    -- Constraints and Indexes
    
    ALTER TABLE [dbo].[tblAnnualPerformanceHistory] WITH NOCHECK ADD CONSTRAINT [CK_tblAnnualPerformanceHistory] CHECK (([PerfYear] >= 1900 and [PerfYear] <= 2200))
    GO
    ALTER TABLE [dbo].[tblAnnualPerformanceHistory] ADD CONSTRAINT [aaaaatblAnnualPerformanceHistory_PK] PRIMARY KEY NONCLUSTERED  ([AnnualPerformanceHistoryID]) WITH (FILLFACTOR=90) ON [PRIMARY]
    GO
    CREATE NONCLUSTERED INDEX [ID] ON [dbo].[tblAnnualPerformanceHistory] ([AnnualPerformanceHistoryID]) WITH (FILLFACTOR=90) ON [PRIMARY]
    GO
    CREATE NONCLUSTERED INDEX [FundID] ON [dbo].[tblAnnualPerformanceHistory] ([FundID]) WITH (FILLFACTOR=90) ON [PRIMARY]
    GO
    CREATE NONCLUSTERED INDEX [MasterFieldsListtblAnnualPerformanceHistory] ON [dbo].[tblAnnualPerformanceHistory] ([FundID]) WITH (FILLFACTOR=90) ON [PRIMARY]
    GO
    -- Foreign Keys
    
    ALTER TABLE [dbo].[tblAnnualPerformanceHistory] ADD CONSTRAINT [tblAnnualPerformanceHisto_FK00] FOREIGN KEY ([FundID]) REFERENCES [dbo].[tblHedgeFunds] ([FundID])
    GO
    -- Extended Properties
    
    DECLARE @xp tinyint
    SELECT @xp=2
    EXEC sp_addextendedproperty N'MS_DefaultView', @xp, 'SCHEMA', N'dbo', 'TABLE', N'tblAnnualPerformanceHistory', NULL, NULL
    GO
    EXEC sp_addextendedproperty N'MS_Filter', NULL, 'SCHEMA', N'dbo', 'TABLE', N'tblAnnualPerformanceHistory', NULL, NULL
    GO
    EXEC sp_addextendedproperty N'MS_OrderBy', NULL, 'SCHEMA', N'dbo', 'TABLE', N'tblAnnualPerformanceHistory', NULL, NULL
    GO
    DECLARE @xp bit
    SELECT @xp=0
    EXEC sp_addextendedproperty N'MS_OrderByOn', @xp, 'SCHEMA', N'dbo', 'TABLE', N'tblAnnualPerformanceHistory', NULL, NULL
    GO
    DECLARE @xp tinyint
    SELECT @xp=0
    EXEC sp_addextendedproperty N'MS_Orientation', @xp, 'SCHEMA', N'dbo', 'TABLE', N'tblAnnualPerformanceHistory', NULL, NULL
    GO
    DECLARE @xp int
    SELECT @xp=10000
    EXEC sp_addextendedproperty N'MS_TableMaxRecords', @xp, 'SCHEMA', N'dbo', 'TABLE', N'tblAnnualPerformanceHistory', NULL, NULL
    GO
    DECLARE @xp bit
    SELECT @xp=0
    EXEC sp_addextendedproperty N'MS_ColumnHidden', @xp, 'SCHEMA', N'dbo', 'TABLE', N'tblAnnualPerformanceHistory', 'COLUMN', N'AnnualPerformanceHistoryID'
    GO
    DECLARE @xp smallint
    SELECT @xp=0
    EXEC sp_addextendedproperty N'MS_ColumnOrder', @xp, 'SCHEMA', N'dbo', 'TABLE', N'tblAnnualPerformanceHistory', 'COLUMN', N'AnnualPerformanceHistoryID'
    GO
    DECLARE @xp smallint
    SELECT @xp=-1
    EXEC sp_addextendedproperty N'MS_ColumnWidth', @xp, 'SCHEMA', N'dbo', 'TABLE', N'tblAnnualPerformanceHistory', 'COLUMN', N'AnnualPerformanceHistoryID'
    GO
    DECLARE @xp bit
    SELECT @xp=0
    EXEC sp_addextendedproperty N'MS_ColumnHidden', @xp, 'SCHEMA', N'dbo', 'TABLE', N'tblAnnualPerformanceHistory', 'COLUMN', N'CheckedFlag'
    GO
    DECLARE @xp smallint
    SELECT @xp=0
    EXEC sp_addextendedproperty N'MS_ColumnOrder', @xp, 'SCHEMA', N'dbo', 'TABLE', N'tblAnnualPerformanceHistory', 'COLUMN', N'CheckedFlag'
    GO
    DECLARE @xp smallint
    SELECT @xp=-1
    EXEC sp_addextendedproperty N'MS_ColumnWidth', @xp, 'SCHEMA', N'dbo', 'TABLE', N'tblAnnualPerformanceHistory', 'COLUMN', N'CheckedFlag'
    GO
    EXEC sp_addextendedproperty N'MS_DisplayControl', N'109', 'SCHEMA', N'dbo', 'TABLE', N'tblAnnualPerformanceHistory', 'COLUMN', N'CheckedFlag'
    GO
    EXEC sp_addextendedproperty N'MS_Format', N'', 'SCHEMA', N'dbo', 'TABLE', N'tblAnnualPerformanceHistory', 'COLUMN', N'CheckedFlag'
    GO
    EXEC sp_addextendedproperty N'MS_IMEMode', N'0', 'SCHEMA', N'dbo', 'TABLE', N'tblAnnualPerformanceHistory', 'COLUMN', N'CheckedFlag'
    GO
    DECLARE @xp bit
    SELECT @xp=0
    EXEC sp_addextendedproperty N'MS_ColumnHidden', @xp, 'SCHEMA', N'dbo', 'TABLE', N'tblAnnualPerformanceHistory', 'COLUMN', N'EstimateFlag'
    GO
    DECLARE @xp smallint
    SELECT @xp=0
    EXEC sp_addextendedproperty N'MS_ColumnOrder', @xp, 'SCHEMA', N'dbo', 'TABLE', N'tblAnnualPerformanceHistory', 'COLUMN', N'EstimateFlag'
    GO
    DECLARE @xp smallint
    SELECT @xp=-1
    EXEC sp_addextendedproperty N'MS_ColumnWidth', @xp, 'SCHEMA', N'dbo', 'TABLE', N'tblAnnualPerformanceHistory', 'COLUMN', N'EstimateFlag'
    GO
    EXEC sp_addextendedproperty N'MS_DisplayControl', N'109', 'SCHEMA', N'dbo', 'TABLE', N'tblAnnualPerformanceHistory', 'COLUMN', N'EstimateFlag'
    GO
    EXEC sp_addextendedproperty N'MS_Format', N'', 'SCHEMA', N'dbo', 'TABLE', N'tblAnnualPerformanceHistory', 'COLUMN', N'EstimateFlag'
    GO
    EXEC sp_addextendedproperty N'MS_IMEMode', N'0', 'SCHEMA', N'dbo', 'TABLE', N'tblAnnualPerformanceHistory', 'COLUMN', N'EstimateFlag'
    GO
    DECLARE @xp bit
    SELECT @xp=0
    EXEC sp_addextendedproperty N'MS_ColumnHidden', @xp, 'SCHEMA', N'dbo', 'TABLE', N'tblAnnualPerformanceHistory', 'COLUMN', N'FundID'
    GO
    DECLARE @xp smallint
    SELECT @xp=0
    EXEC sp_addextendedproperty N'MS_ColumnOrder', @xp, 'SCHEMA', N'dbo', 'TABLE', N'tblAnnualPerformanceHistory', 'COLUMN', N'FundID'
    GO
    DECLARE @xp smallint
    SELECT @xp=-1
    EXEC sp_addextendedproperty N'MS_ColumnWidth', @xp, 'SCHEMA', N'dbo', 'TABLE', N'tblAnnualPerformanceHistory', 'COLUMN', N'FundID'
    GO
    DECLARE @xp bit
    SELECT @xp=0
    EXEC sp_addextendedproperty N'MS_ColumnHidden', @xp, 'SCHEMA', N'dbo', 'TABLE', N'tblAnnualPerformanceHistory', 'COLUMN', N'GrossFlag'
    GO
    DECLARE @xp smallint
    SELECT @xp=0
    EXEC sp_addextendedproperty N'MS_ColumnOrder', @xp, 'SCHEMA', N'dbo', 'TABLE', N'tblAnnualPerformanceHistory', 'COLUMN', N'GrossFlag'
    GO
    DECLARE @xp smallint
    SELECT @xp=-1
    EXEC sp_addextendedproperty N'MS_ColumnWidth', @xp, 'SCHEMA', N'dbo', 'TABLE', N'tblAnnualPerformanceHistory', 'COLUMN', N'GrossFlag'
    GO
    EXEC sp_addextendedproperty N'MS_DisplayControl', N'109', 'SCHEMA', N'dbo', 'TABLE', N'tblAnnualPerformanceHistory', 'COLUMN', N'GrossFlag'
    GO
    EXEC sp_addextendedproperty N'MS_Format', N'', 'SCHEMA', N'dbo', 'TABLE', N'tblAnnualPerformanceHistory', 'COLUMN', N'GrossFlag'
    GO
    EXEC sp_addextendedproperty N'MS_IMEMode', N'0', 'SCHEMA', N'dbo', 'TABLE', N'tblAnnualPerformanceHistory', 'COLUMN', N'GrossFlag'
    GO
    DECLARE @xp bit
    SELECT @xp=0
    EXEC sp_addextendedproperty N'MS_ColumnHidden', @xp, 'SCHEMA', N'dbo', 'TABLE', N'tblAnnualPerformanceHistory', 'COLUMN', N'Performance'
    GO
    DECLARE @xp smallint
    SELECT @xp=0
    EXEC sp_addextendedproperty N'MS_ColumnOrder', @xp, 'SCHEMA', N'dbo', 'TABLE', N'tblAnnualPerformanceHistory', 'COLUMN', N'Performance'
    GO
    DECLARE @xp smallint
    SELECT @xp=-1
    EXEC sp_addextendedproperty N'MS_ColumnWidth', @xp, 'SCHEMA', N'dbo', 'TABLE', N'tblAnnualPerformanceHistory', 'COLUMN', N'Performance'
    GO
    DECLARE @xp bit
    SELECT @xp=0
    EXEC sp_addextendedproperty N'MS_ColumnHidden', @xp, 'SCHEMA', N'dbo', 'TABLE', N'tblAnnualPerformanceHistory', 'COLUMN', N'PerfYear'
    GO
    DECLARE @xp smallint
    SELECT @xp=0
    EXEC sp_addextendedproperty N'MS_ColumnOrder', @xp, 'SCHEMA', N'dbo', 'TABLE', N'tblAnnualPerformanceHistory', 'COLUMN', N'PerfYear'
    GO
    DECLARE @xp smallint
    SELECT @xp=-1
    EXEC sp_addextendedproperty N'MS_ColumnWidth', @xp, 'SCHEMA', N'dbo', 'TABLE', N'tblAnnualPerformanceHistory', 'COLUMN', N'PerfYear'
    GO
    

    Source Control
    -- Columns
    
    CREATE TABLE [dbo].[tblAnnualPerformanceHistory]
    (
    [AnnualPerformanceHistoryID] [int] NOT NULL IDENTITY(1, 1) NOT FOR REPLICATION,
    [FundID] [int] NOT NULL CONSTRAINT [DF__Temporary__FundI__7720AD13] DEFAULT ((0)),
    [PerfYear] [smallint] NOT NULL,
    [Performance] [float] NULL,
    [EstimateFlag] [bit] NOT NULL CONSTRAINT [DF_tblAnnualPerformanceHistory_EstimateFlag] DEFAULT ((0)),
    [GrossFlag] [bit] NOT NULL CONSTRAINT [DF_tblAnnualPerformanceHistory_GrossFlag] DEFAULT ((0)),
    [CheckedFlag] [bit] NOT NULL CONSTRAINT [DF_tblAnnualPerformanceHistory_CheckedFlag] DEFAULT ((0)),
    [PerformanceSourceID] [int] NOT NULL CONSTRAINT [DF_tblAnnualPerformanceHistory_SourceID] DEFAULT ((1)),
    [DateEntered] [smalldatetime] NULL CONSTRAINT [DF_tblAnnualPerformanceHistory_DateEntered] DEFAULT (getdate())
    ) ON [PRIMARY]
    GO
    -- Triggers
    
    CREATE TRIGGER [dbo].[tblAnnualPerformanceHist_ITrig] ON [dbo].[tblAnnualPerformanceHistory] FOR INSERT AS
    SET NOCOUNT ON
    /* * VALIDATION RULE FOR FIELD 'PerfYear' */
    IF (SELECT Count(*) FROM inserted WHERE NOT (PerfYear>1900 And PerfYear<2999)) > 0
        BEGIN
            RAISERROR 44444 'You must enter a year betwen 1900 and 2999!'
            ROLLBACK TRANSACTION
        END
    GO
    CREATE TRIGGER [dbo].[tblAnnualPerformanceHist_UTrig] ON [dbo].[tblAnnualPerformanceHistory] FOR UPDATE AS
    SET NOCOUNT ON
    /* * VALIDATION RULE FOR FIELD 'PerfYear' */
    IF (SELECT Count(*) FROM inserted WHERE NOT (PerfYear>1900 And PerfYear<2999)) > 0
        BEGIN
            RAISERROR 44444 'You must enter a year betwen 1900 and 2999!'
            ROLLBACK TRANSACTION
        END
    GO
    -- Constraints and Indexes
    
    ALTER TABLE [dbo].[tblAnnualPerformanceHistory] WITH NOCHECK ADD CONSTRAINT [CK_tblAnnualPerformanceHistory] CHECK (([PerfYear]>=(1900) AND [PerfYear]<=(2200)))
    GO
    ALTER TABLE [dbo].[tblAnnualPerformanceHistory] ADD CONSTRAINT [aaaaatblAnnualPerformanceHistory_PK] PRIMARY KEY NONCLUSTERED  ([AnnualPerformanceHistoryID]) WITH (FILLFACTOR=90) ON [PRIMARY]
    GO
    CREATE NONCLUSTERED INDEX [ID] ON [dbo].[tblAnnualPerformanceHistory] ([AnnualPerformanceHistoryID]) WITH (FILLFACTOR=90) ON [PRIMARY]
    GO
    CREATE NONCLUSTERED INDEX [FundID] ON [dbo].[tblAnnualPerformanceHistory] ([FundID]) WITH (FILLFACTOR=90) ON [PRIMARY]
    GO
    CREATE NONCLUSTERED INDEX [MasterFieldsListtblAnnualPerformanceHistory] ON [dbo].[tblAnnualPerformanceHistory] ([FundID]) WITH (FILLFACTOR=90) ON [PRIMARY]
    GO
    -- Foreign Keys
    
    ALTER TABLE [dbo].[tblAnnualPerformanceHistory] WITH NOCHECK ADD CONSTRAINT [tblAnnualPerformanceHisto_FK00] FOREIGN KEY ([FundID]) REFERENCES [dbo].[tblHedgeFunds] ([FundID])
    GO
    -- Extended Properties
    
    DECLARE @xp tinyint
    SELECT @xp=2
    EXEC sp_addextendedproperty N'MS_DefaultView', @xp, 'SCHEMA', N'dbo', 'TABLE', N'tblAnnualPerformanceHistory', NULL, NULL
    GO
    EXEC sp_addextendedproperty N'MS_Filter', NULL, 'SCHEMA', N'dbo', 'TABLE', N'tblAnnualPerformanceHistory', NULL, NULL
    GO
    EXEC sp_addextendedproperty N'MS_OrderBy', NULL, 'SCHEMA', N'dbo', 'TABLE', N'tblAnnualPerformanceHistory', NULL, NULL
    GO
    DECLARE @xp bit
    SELECT @xp=0
    EXEC sp_addextendedproperty N'MS_OrderByOn', @xp, 'SCHEMA', N'dbo', 'TABLE', N'tblAnnualPerformanceHistory', NULL, NULL
    GO
    DECLARE @xp tinyint
    SELECT @xp=0
    EXEC sp_addextendedproperty N'MS_Orientation', @xp, 'SCHEMA', N'dbo', 'TABLE', N'tblAnnualPerformanceHistory', NULL, NULL
    GO
    DECLARE @xp int
    SELECT @xp=10000
    EXEC sp_addextendedproperty N'MS_TableMaxRecords', @xp, 'SCHEMA', N'dbo', 'TABLE', N'tblAnnualPerformanceHistory', NULL, NULL
    GO
    DECLARE @xp bit
    SELECT @xp=0
    EXEC sp_addextendedproperty N'MS_ColumnHidden', @xp, 'SCHEMA', N'dbo', 'TABLE', N'tblAnnualPerformanceHistory', 'COLUMN', N'AnnualPerformanceHistoryID'
    GO
    DECLARE @xp smallint
    SELECT @xp=0
    EXEC sp_addextendedproperty N'MS_ColumnOrder', @xp, 'SCHEMA', N'dbo', 'TABLE', N'tblAnnualPerformanceHistory', 'COLUMN', N'AnnualPerformanceHistoryID'
    GO
    DECLARE @xp smallint
    SELECT @xp=-1
    EXEC sp_addextendedproperty N'MS_ColumnWidth', @xp, 'SCHEMA', N'dbo', 'TABLE', N'tblAnnualPerformanceHistory', 'COLUMN', N'AnnualPerformanceHistoryID'
    GO
    DECLARE @xp bit
    SELECT @xp=0
    EXEC sp_addextendedproperty N'MS_ColumnHidden', @xp, 'SCHEMA', N'dbo', 'TABLE', N'tblAnnualPerformanceHistory', 'COLUMN', N'CheckedFlag'
    GO
    DECLARE @xp smallint
    SELECT @xp=0
    EXEC sp_addextendedproperty N'MS_ColumnOrder', @xp, 'SCHEMA', N'dbo', 'TABLE', N'tblAnnualPerformanceHistory', 'COLUMN', N'CheckedFlag'
    GO
    DECLARE @xp smallint
    SELECT @xp=-1
    EXEC sp_addextendedproperty N'MS_ColumnWidth', @xp, 'SCHEMA', N'dbo', 'TABLE', N'tblAnnualPerformanceHistory', 'COLUMN', N'CheckedFlag'
    GO
    EXEC sp_addextendedproperty N'MS_DisplayControl', N'109', 'SCHEMA', N'dbo', 'TABLE', N'tblAnnualPerformanceHistory', 'COLUMN', N'CheckedFlag'
    GO
    EXEC sp_addextendedproperty N'MS_Format', N'', 'SCHEMA', N'dbo', 'TABLE', N'tblAnnualPerformanceHistory', 'COLUMN', N'CheckedFlag'
    GO
    EXEC sp_addextendedproperty N'MS_IMEMode', N'0', 'SCHEMA', N'dbo', 'TABLE', N'tblAnnualPerformanceHistory', 'COLUMN', N'CheckedFlag'
    GO
    DECLARE @xp bit
    SELECT @xp=0
    EXEC sp_addextendedproperty N'MS_ColumnHidden', @xp, 'SCHEMA', N'dbo', 'TABLE', N'tblAnnualPerformanceHistory', 'COLUMN', N'EstimateFlag'
    GO
    DECLARE @xp smallint
    SELECT @xp=0
    EXEC sp_addextendedproperty N'MS_ColumnOrder', @xp, 'SCHEMA', N'dbo', 'TABLE', N'tblAnnualPerformanceHistory', 'COLUMN', N'EstimateFlag'
    GO
    DECLARE @xp smallint
    SELECT @xp=-1
    EXEC sp_addextendedproperty N'MS_ColumnWidth', @xp, 'SCHEMA', N'dbo', 'TABLE', N'tblAnnualPerformanceHistory', 'COLUMN', N'EstimateFlag'
    GO
    EXEC sp_addextendedproperty N'MS_DisplayControl', N'109', 'SCHEMA', N'dbo', 'TABLE', N'tblAnnualPerformanceHistory', 'COLUMN', N'EstimateFlag'
    GO
    EXEC sp_addextendedproperty N'MS_Format', N'', 'SCHEMA', N'dbo', 'TABLE', N'tblAnnualPerformanceHistory', 'COLUMN', N'EstimateFlag'
    GO
    EXEC sp_addextendedproperty N'MS_IMEMode', N'0', 'SCHEMA', N'dbo', 'TABLE', N'tblAnnualPerformanceHistory', 'COLUMN', N'EstimateFlag'
    GO
    DECLARE @xp bit
    SELECT @xp=0
    EXEC sp_addextendedproperty N'MS_ColumnHidden', @xp, 'SCHEMA', N'dbo', 'TABLE', N'tblAnnualPerformanceHistory', 'COLUMN', N'FundID'
    GO
    DECLARE @xp smallint
    SELECT @xp=0
    EXEC sp_addextendedproperty N'MS_ColumnOrder', @xp, 'SCHEMA', N'dbo', 'TABLE', N'tblAnnualPerformanceHistory', 'COLUMN', N'FundID'
    GO
    DECLARE @xp smallint
    SELECT @xp=-1
    EXEC sp_addextendedproperty N'MS_ColumnWidth', @xp, 'SCHEMA', N'dbo', 'TABLE', N'tblAnnualPerformanceHistory', 'COLUMN', N'FundID'
    GO
    DECLARE @xp bit
    SELECT @xp=0
    EXEC sp_addextendedproperty N'MS_ColumnHidden', @xp, 'SCHEMA', N'dbo', 'TABLE', N'tblAnnualPerformanceHistory', 'COLUMN', N'GrossFlag'
    GO
    DECLARE @xp smallint
    SELECT @xp=0
    EXEC sp_addextendedproperty N'MS_ColumnOrder', @xp, 'SCHEMA', N'dbo', 'TABLE', N'tblAnnualPerformanceHistory', 'COLUMN', N'GrossFlag'
    GO
    DECLARE @xp smallint
    SELECT @xp=-1
    EXEC sp_addextendedproperty N'MS_ColumnWidth', @xp, 'SCHEMA', N'dbo', 'TABLE', N'tblAnnualPerformanceHistory', 'COLUMN', N'GrossFlag'
    GO
    EXEC sp_addextendedproperty N'MS_DisplayControl', N'109', 'SCHEMA', N'dbo', 'TABLE', N'tblAnnualPerformanceHistory', 'COLUMN', N'GrossFlag'
    GO
    EXEC sp_addextendedproperty N'MS_Format', N'', 'SCHEMA', N'dbo', 'TABLE', N'tblAnnualPerformanceHistory', 'COLUMN', N'GrossFlag'
    GO
    EXEC sp_addextendedproperty N'MS_IMEMode', N'0', 'SCHEMA', N'dbo', 'TABLE', N'tblAnnualPerformanceHistory', 'COLUMN', N'GrossFlag'
    GO
    DECLARE @xp bit
    SELECT @xp=0
    EXEC sp_addextendedproperty N'MS_ColumnHidden', @xp, 'SCHEMA', N'dbo', 'TABLE', N'tblAnnualPerformanceHistory', 'COLUMN', N'Performance'
    GO
    DECLARE @xp smallint
    SELECT @xp=0
    EXEC sp_addextendedproperty N'MS_ColumnOrder', @xp, 'SCHEMA', N'dbo', 'TABLE', N'tblAnnualPerformanceHistory', 'COLUMN', N'Performance'
    GO
    DECLARE @xp smallint
    SELECT @xp=-1
    EXEC sp_addextendedproperty N'MS_ColumnWidth', @xp, 'SCHEMA', N'dbo', 'TABLE', N'tblAnnualPerformanceHistory', 'COLUMN', N'Performance'
    GO
    DECLARE @xp bit
    SELECT @xp=0
    EXEC sp_addextendedproperty N'MS_ColumnHidden', @xp, 'SCHEMA', N'dbo', 'TABLE', N'tblAnnualPerformanceHistory', 'COLUMN', N'PerfYear'
    GO
    DECLARE @xp smallint
    SELECT @xp=0
    EXEC sp_addextendedproperty N'MS_ColumnOrder', @xp, 'SCHEMA', N'dbo', 'TABLE', N'tblAnnualPerformanceHistory', 'COLUMN', N'PerfYear'
    GO
    DECLARE @xp smallint
    SELECT @xp=-1
    EXEC sp_addextendedproperty N'MS_ColumnWidth', @xp, 'SCHEMA', N'dbo', 'TABLE', N'tblAnnualPerformanceHistory', 'COLUMN', N'PerfYear'
    GO
    
  • Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    Thanks for your patience.... this was pretty easy to reproduce and I think it's a long-standing issue with the SQL view that started in SQL Compare (the basic code around which Source Control's comparisons are made). I'll send the reproduction to Chris but basically as far as I can tell, the doubled-up parens come from SQL Server and do not trigger a difference that would need to be synchronized. It should simply be an aestetic problem.
  • MartinUMartinU Posts: 14 Bronze 1
    I have encountered this exact same thing. I manually edited the file within source control and checked it in and the difference then quit showing up. Not to say that it may not come back once a change is done to the object within the database.
  • Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    I guess editing the scripts by hand would work, for now. If the scripts are generated by SQL Compare, though, they are potentially going to cause this to happen. So if the object gets updated in the database, you would potentially see this again.
Sign In or Register to comment.