-
Notifications
You must be signed in to change notification settings - Fork 25
Description
- SqlPackage or DacFx Version: 170.0.70-preview
- .NET Framework (Windows-only) or .NET Core:
- Environment (local platform and source/target platforms): Windows, source DB - Fabric Datawarehouse.
Steps to Reproduce:
- create a new Fabric Datawarehouse, and get connection string from it.
- create the following table and a constraint:
CREATE TABLE [dw6].[dbo].[Geography]
(
[GeographyID] [int] NOT NULL,
...
)
GO
ALTER TABLE [dbo].[Geography] ADD CONSTRAINT [t] UNIQUE NONCLUSTERED ([GeographyID] ASC) NOT ENFORCED;
then call sqlpackage.exe extract and check results:
❯ sqlpackage.exe /at:%token% /action:Extract /p:ExtractTarget=File /TargetFile:"C:\src\tempfile170.sql" /SourceConnectionString:"Server=;Initial Catalog=dw1;Encrypt=True;"
Connecting to database 'dw1' on server ''.
Extracting schema
Extracting schema from database
Resolving references in schema model
Exporting database objects
Validating schema model for data package
Validating schema
Successfully extracted database and saved it to file 'C:\src\tempfile170.sql'.
Changes to connection setting default values were incorporated in a recent release. More information is available at https://aka.ms/dacfx-connection
Time elapsed 0:00:10.21
in resulting .sql file there is the table, but no constraint.
it works correctly without the /p:ExtractTarget=File flag:
❯ sqlpackage.exe /at:%token% /action:Extract /TargetFile:"C:\src\tempfile170.dacpac" /SourceConnectionString:"Server=;Initial Catalog=dw1;Encrypt=True;"
Connecting to database 'dw1' on server ''.
Extracting schema
Extracting schema from database
Resolving references in schema model
Exporting database objects
Validating schema model for data package
Validating schema
Successfully extracted database and saved it to file 'C:\src\tempfile170.dacpac'.
Changes to connection setting default values were incorporated in a recent release. More information is available at https://aka.ms/dacfx-connection
Time elapsed 0:00:12.71
if you open dacpac file, there is constraint exists in it.
constraint exists in the DB and can be seen in SSMS.
Did this occur in prior versions? If not - which version(s) did it work in?
yes, tested on version 162 too, observed the same behavior.
(DacFx/SqlPackage/SSMS/Azure Data Studio)
SqlPackage
Attached extract results sql and dacpac version
tempfile170.zip