[ ] Regression (a behavior that used to work and stopped working in a new release)
[ x] Bug report
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead go to https://varigence.com/Forums?forumName=Biml or email support@varigence.com
[ ] Other... Please describe:
Current behavior
For all tables in my database, GetDropAndCreateDdl is generating incorrect clustering types for the primary key, the tables in the database are defined as clustered, the BIML generated code defines the key as nonclustered.
var destTableResults = targetConnection.GetDatabaseSchema();
var destTable = destTableResults.TableNodes.First();
var inccorectCreateTableSql= destTable.GetDropAndCreateDdl();
Table Def in SQL:
CREATE TABLE [bi].[HierachySites](
[Code] [UNIQUEIDENTIFIER] NOT NULL,
[Name] VARCHAR NOT NULL,
[EnterDateTime] [SMALLDATETIME] NOT NULL,
CONSTRAINT [PK_HierachySites] PRIMARY KEY CLUSTERED
(
[Code] ASC
)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
GetDropAndCreateDdl generated code for same table:
CREATE TABLE [bi].[HierachySites]
(
-- Columns Definition
[Code] uniqueidentifier NOT NULL
, [Name] varchar(21) NOT NULL
, [EnterDateTime] smalldatetime NOT NULL
For the clustering type generated by GetDatabaseSchema().TableNodes.ElementAt(x).GetDropAndCreateDdl to match the source table clustering type.
Minimal reproduction of the problem with instructions
var destTableResults = targetConnection.GetDatabaseSchema();
var destTable = destTableResults.TableNodes.First();
var inccorectCreateTableSql= destTable.GetDropAndCreateDdl();
What is the motivation / use case for changing the behavior?
When building my staging environment I do not want to drop and create the tables if the definition is the same. When I compare the DropAndCreateDdl statement that is generated from my in memory model where I manually code the clustering type, it does not equal the DropAndCreateDdl statment of the GetDatabaseSchema generated model because of the incorrect clustering definition. The same table was created using the in memory model GetDropAndCreateDdl.
I'm submitting a...
Current behavior
For all tables in my database, GetDropAndCreateDdl is generating incorrect clustering types for the primary key, the tables in the database are defined as clustered, the BIML generated code defines the key as nonclustered.
var destTableResults = targetConnection.GetDatabaseSchema(); var destTable = destTableResults.TableNodes.First(); var inccorectCreateTableSql= destTable.GetDropAndCreateDdl();
Table Def in SQL:
CREATE TABLE [bi].[HierachySites]( [Code] [UNIQUEIDENTIFIER] NOT NULL, [Name] VARCHAR NOT NULL, [EnterDateTime] [SMALLDATETIME] NOT NULL, CONSTRAINT [PK_HierachySites] PRIMARY KEY CLUSTERED ( [Code] ASC )WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY] ) ON [PRIMARY]
GetDropAndCreateDdl generated code for same table:
CREATE TABLE [bi].[HierachySites] ( -- Columns Definition [Code] uniqueidentifier NOT NULL , [Name] varchar(21) NOT NULL , [EnterDateTime] smalldatetime NOT NULL
-- Constraints ,CONSTRAINT [PK_HierachySites] PRIMARY KEY NONCLUSTERED ( [Code] Asc) WITH(PAD_INDEX = OFF,IGNORE_DUP_KEY = OFF) ON "default"
) ON "default" WITH (DATA_COMPRESSION = NONE)
Expected behavior
For the clustering type generated by GetDatabaseSchema().TableNodes.ElementAt(x).GetDropAndCreateDdl to match the source table clustering type.
Minimal reproduction of the problem with instructions
var destTableResults = targetConnection.GetDatabaseSchema(); var destTable = destTableResults.TableNodes.First(); var inccorectCreateTableSql= destTable.GetDropAndCreateDdl();
What is the motivation / use case for changing the behavior?
When building my staging environment I do not want to drop and create the tables if the definition is the same. When I compare the DropAndCreateDdl statement that is generated from my in memory model where I manually code the clustering type, it does not equal the DropAndCreateDdl statment of the GetDatabaseSchema generated model because of the incorrect clustering definition. The same table was created using the in memory model GetDropAndCreateDdl.
Environment