DacFx
DacFx copied to clipboard
Export fails with error - SQL71623: Model translation is not allowed because the model contains 1 errors
Export fails when stored procedure contains DDL that references a user-defined function. Workaround is to use SqlPackage Extract action with /p:ExtractAllTableData=true
.
- SqlPackage or DacFx Version: 15.0.5282.3
- .NET Framework (Windows-only) or .NET Core: .NET Core
- Environment (local platform and source/target platforms): SQL 2019 & Azure
Steps to Reproduce:
- Create database with following schema
CREATE FUNCTION [dbo].[Function1]()
RETURNS INT
AS
BEGIN
RETURN 1
END
GO
CREATE TABLE [dbo].[Table1](
[DateCol] [date] NOT NULL,
[FuncCol] [int] NOT NULL DEFAULT (CONVERT(INT, [dbo].[Function1]())),
) ON [PRIMARY]
GO
CREATE PROCEDURE [dbo].[Procedure1]
AS
BEGIN
CREATE TABLE [dbo].Table1(
[DateCol] [date] NOT NULL,
[FuncCol] [int] NOT NULL DEFAULT (CONVERT(INT, [dbo].[Function1]())),
);
END
GO
- Export will fail with following error:
@zijchen didn't you already fix this?
@llali no I recall working on this and verifying that it's reproducible, but don't think a fix was implemented yet.