Export SqlDatabase to Bacpac using SqlPackage.exe fails on fillfactor

3.5k views Asked by At

I am using the following command to execute sqlpackage to export a bacpac for a local db.

"C:\Program Files (x86)\Microsoft SQL Server\110\DAC\bin\sqlpackage.exe" /action:Export /tf:".\dbname_Baseline.bacpac" /SourceConnectionString:"XXXXXXXXXXXX"

It fails saying "Element Primary Key: [dbo].[PK_Name] has an unsupported property FillFactor set and is not supported when used as part of a data package."

I understand fillfactor is not supported but is there anything to make it ignore unsupported properties?

Thanks

Mark

2

There are 2 answers

2
Eoin Campbell On

Pass the switch

/p:IgnoreFillFactor ={ True | False }
2
Ubercoder On

I have been experimenting with exporting to bacpac for a small database of around 1GB and you can reconfigure the fillfactor in the database. In SQL Server Manager Studio, just script a 'drop and re-create' for the index, edit the generated script to remove the fillfactor specification, run the script and this re-creates the index with a default fill factor acceptable to sqlpackage.exe. This should work for PKs as well as indexes, it should be quick for small databases and should have no adverse effect on the database.

I realize this doesn't answer the question about making sqlpackage.exe ignore some errors, but it is probably a better way of fixing the problem as it does so directly in the database.