Forum Discussion
ToniPohl
Sep 03, 2017MVP
BACPAC: Could not import package. SQL72012
Hi SQL-guys, I'm running into this error during the last days and could not find a solution: I am trying to import a database .BACPAC file from SQL Azure into my local SQL Server. When doing so...
ToniPohl
Sep 08, 2017MVP
Hi all, I figured out that the reconfiguration works properly with _most_ of my databases (but not all). So it seems, the issue is dependent on the database and the authentication used in there. Need to figure out a complete solution for that...
Fredrik Hansson
Sep 14, 2017Copper Contributor
Hi,
I have the exact same problem. Done the same upgrades as you and even upgraded my local SQL Server to the latest service pack (2016 sp1).
Did you find any permanent solution for this? Have tried the above with no luck.
Br,
Fredrik
- ToniPohlSep 17, 2017MVP
Hi Fredrik,
yes!
It turned out that when I imported the same database into another SQL Azure Server, I received the following error:
Could not import package.
Error SQL72014: .Net SqlClient Data Provider: Msg 468, Level 16, State 9, Procedure vwSomeView, Line 3
Cannot resolve the collation conflict between "SQL_Latin1_General_CP1_CI_AS" and "Latin1_General_CI_AS" in the UNION operation.
Error SQL72045: Script execution error. The executed script:
CREATE VIEW [dbo].[vwSomeView] ...
So, this lead me to the solution. Obviously, in my database, I added some new columns and that was done in with a different collation. That caused my errors.
To make it short, my solution had 2 parts:
1. https://www.sqlservercentral.com/Forums/PrintTopic1886371.aspx
2. I needed to convert all columns to the same collation, similar as here:
ALTER TABLE MyTable ALTER COLUMN [MyColumn1] varchar(MAX) COLLATE Latin1_General_CI_AS NULL
Since this would mean a lot of effort I found a Stored Procedure script that runs through all tables and generates that ALTER script from https://stackoverflow.com/questions/18122773/change-collations-of-all-columns-of-all-tables-in-sql-server
After These two steps, I regenerated the BACPAC and I was able to Import that database.
I hope I find some time to publish that in my blog in the next days to make a detailled description about my scenario.
Hope that helps?!
br, Toni- DeletedDec 17, 2018
Thank you so much!
I used
sp_configure 'contained database authentication', 1; GO RECONFIGURE; GO
to enables contained databases on the instance of the Database Engine
- kanchan_Feb 27, 2020Copper Contributor
Hello Sir please tell me where do we run this reconfigure code ....on the target server where we r trying to import the bacpac file....Pls answer.Thanks
I ran the same code on target server where we r trying to import the bacpac file but again the same error.
please suggest..thanks