Skip to content

Commit 5275591

Browse files
authored
Implement feedback from Drew
1 parent b058bbb commit 5275591

1 file changed

Lines changed: 16 additions & 15 deletions

File tree

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

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,22 @@ The connection string provided contains encryption settings which may lead to co
8888
8989
More information about the connection security changes in SqlPackage is available in this [blog post](https://aka.ms/dacfx-connection).
9090
91+
92+
### Import action error 2714 for constraint
93+
94+
When performing an import action you may receive error 2714 as below if an object already exists.
95+
```
96+
*** Error importing database:Could not import package.
97+
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.
98+
Error SQL72045: Script execution error. The executed script:
99+
ALTER TABLE [HumanResources].[Department]
100+
ADD CONSTRAINT [DF_Department_ModifiedDate_] DEFAULT ('') FOR [ModifiedDate];
101+
```
102+
There are a couple causes and solutions to workaround this error:
103+
1) Verify that the destination you are importing into is an empty database.
104+
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).
105+
3) Manually edit the model.xml and rename the constraint with the name experiencing the error to a unique name. This option should be undertaken only if directed by Microsoft support and poses a risk of bacpac corruption.
106+
91107
## Diagnostics
92108
Logs are essential to troubleshooting. Capture the diagnostic logs to a file with the `/DiagnosticsFile:<filename>` parameter.
93109
@@ -108,21 +124,6 @@ During an export process the table data is compressed in the bacpac file. The us
108124
109125
To obtain the database schema and data while skipping the schema validation, perform an [Export](sqlpackage-export.md) with the property `/p:VerifyExtraction=True`.
110126
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-
126127
127128
## Azure SQL Database
128129

0 commit comments

Comments
 (0)