Skip to content

Check constraints repeated multiple times #761

@feilbaca

Description

@feilbaca

Hi,
I've found another issue with exporting from SQL Server:

Many of our tables have one or more check constraints, and on checking the SIARD file after export, I noticed that each of these constraints seemed to have been read and added multiple times. After a bit of experimenting I figured out that this only happens with constraints that call a user-defined function with more than one parameter, and then each constraint gets added once per parameter. For example:

<checkConstraints>
    <checkConstraint>
        <name>Check_tbTestTable_Test</name>
        <condition>([dbo].[udfTestFunction]([TestTable_ID],[TestTable_Int])=(1))</condition>
	</checkConstraint>
	<checkConstraint>
		<name>Check_tbTestTable_Test</name>
		<condition>([dbo].[udfTestFunction]([TestTable_ID],[TestTable_Int])=(1))</condition>
	</checkConstraint>
</checkConstraints>

I've checked this with varying numbers of params and it happens every time.

Tested with dbptk v4.3.1 from the command line.

Metadata

Metadata

Labels

bugIssue type

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions