Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Commit b058bbb

Browse files
authored
Add 2714 error example
IcM 396149167 & 245940391
1 parent 6d9a7da commit b058bbb

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

docs/tools/sqlpackage/troubleshooting-issues-and-performance-with-sqlpackage.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,22 @@ During an export process the table data is compressed in the bacpac file. The us
108108
109109
To obtain the database schema and data while skipping the schema validation, perform an [Export](sqlpackage-export.md) with the property `/p:VerifyExtraction=True`.
110110
111+
## Import action error 2714 for constraint
112+
113+
When performing an import action against, you may receive error 2714 as below if an object already exists.
114+
```
115+
*** Error importing database:Could not import package.
116+
Error SQL72014: Core Microsoft SqlClient Data Provider: Msg 2714, Level 16, State 5, Line 1 There is already an object named 'DF_Department_ModifiedDate_0FF0B724' in the database.
117+
Error SQL72045: Script execution error. The executed script:
118+
ALTER TABLE [HumanResources].[Department]
119+
ADD CONSTRAINT [DF_Department_ModifiedDate_] DEFAULT ('') FOR [ModifiedDate];
120+
```
121+
There are a couple causes and solutions to workaround this error:
122+
1) Verify that the destination you are importing into is an empty database.
123+
2) If your database has constraints that are using the DEFAULT attribute (so SQL will name the constraint) as well as an explicitly named constraint, you may have an issue where a constraint with the same name is attempted to be created twice. It is recommended to use all explicitly named constraints (not using DEFAULT), or all unexplicitly defined (using DEFAULT).
124+
3) Manually edit the model.xml and rename the constraint with the name experiencing the error to a unique name.
125+
126+
111127
## Azure SQL Database
112128
113129
The following tips are specific to running import or export against Azure SQL Database from an Azure virtual machine (VM):

0 commit comments

Comments
 (0)