Page 1 of 1

Wrong default value

Posted: Thu 27 Jun 2013 13:20
by jmuehlenhoff
Hi,

I've got two tables:

Code: Select all

CREATE TABLE [dbo].[Script] (
    [Script_ID] UNIQUEIDENTIFIER CONSTRAINT [DEF_Script_Script_ID] DEFAULT newid() NOT NULL,
    [Name] NVARCHAR(50) COLLATE Latin1_General_CI_AS NOT NULL,
    [OrderTag] INTEGER,
    [DBAGuid] UNIQUEIDENTIFIER,
    [SQL] NVARCHAR(max) COLLATE Latin1_General_CI_AS NOT NULL,
    [ScriptCondition_ID] UNIQUEIDENTIFIER,
    [ScriptOrder_ID] UNIQUEIDENTIFIER,
    [Predefined] BIT CONSTRAINT [DEF_Script_Predefined] DEFAULT 0 NOT NULL,
    [ArchiveMode] INTEGER CONSTRAINT [DEF_Script_ArchiveMode] DEFAULT 0 NOT NULL,
    CONSTRAINT [PK_Script_dbo] PRIMARY KEY NONCLUSTERED ([Script_ID])
)
GO

CREATE UNIQUE NONCLUSTERED INDEX [IDX_Script_1] ON [dbo].[Script] ([Predefined] ASC,[Name] ASC)
GO

CREATE TABLE [mgmt].[Script] (
    [Script_ID] UNIQUEIDENTIFIER NOT NULL,
    [Name] NVARCHAR(50) COLLATE Latin1_General_CI_AS NOT NULL,
    [OrderTag] INTEGER,
    [DBAGuid] UNIQUEIDENTIFIER,
    [SQL] NVARCHAR(max) COLLATE Latin1_General_CI_AS NOT NULL,
    [ScriptCondition_ID] UNIQUEIDENTIFIER,
    [ScriptOrder_ID] UNIQUEIDENTIFIER,
    [Predefined] BIT CONSTRAINT [DEF_Script_Predefined] DEFAULT 1 NOT NULL,
    [ArchiveMode] INTEGER CONSTRAINT [DEF_Script_ArchiveMode] DEFAULT 0 NOT NULL,
    CONSTRAINT [PK_Script_mgmt] PRIMARY KEY NONCLUSTERED ([Script_ID])
)
GO

CREATE UNIQUE NONCLUSTERED INDEX [IDX_Script_1_mgmt] ON [mgmt].[Script] ([Predefined] ASC,[Name] ASC)
GO
I created a TMSTable with 'Script' as the TableName and Options.DefaultValues set to True.

When I call Table.Insert the field 'Predefined' is set to 'True', but the table 'dbo.Script' has the default value '0' for this field.

Is this a bug in the table component?

I'm using version 6.6.12.

Re: Wrong default value

Posted: Mon 01 Jul 2013 14:02
by AlexP
Hello,

Thank you for the information. We have reproduced the problem and will fix it as soon as possible. For the time being, to solve the problem, you should explicitly specify the schema name before the table name.

Re: Wrong default value

Posted: Thu 11 Jul 2013 06:55
by AndreyZ
Thank you for the information. We have fixed this problem. This fix will be included in the next SDAC build.