web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested answer

Issue with Importing Database(.bacpac)

(1) ShareShare
ReportReport
Posted on by 4
Hello Community, 
I'm trying to import the database(.bacpac)  file to the cloud hosted environment (LCS) in SSMS(.bak), but it is failing with the error shown below:
we tried to search the column in both source and destination databases but there is no such column called 'plan_forcing_type_desc'.
 Below are the source and destination SQL version details :
Source version(SANDBOX)  is Microsoft SQL Azure (RTM)-12.0.2000.8
Destination version (CLOUD HOSTED VM) is Microsoft SQL server 2016 (SP2-CU17-GDR)(KB5014351)-13.0.5893.48(X64)
Can you please confirm if this is a SQL compatibility issue or any other issue ?
 
Error which I got :
 
//
 
 
*** Error importing database:Could not import package.

Error SQL72014: Core Microsoft SqlClient Data Provider: Msg 207, Level 16, State 1, Procedure AutotuneEvictPlansFromCach

e, Line 24 Invalid column name 'plan_forcing_type_desc'.

Error SQL72045: Script execution error.  The executed script:

CREATE PROCEDURE [dbo].[AutotuneEvictPlansFromCache]

@QUERY_ID BIGINT, @EVICTED_PLANS NVARCHAR (MAX) OUTPUT, @CLEARED_QUERY_HINT NVARCHAR (MAX) OUTPUT

AS

BEGIN

    DECLARE @PLAN_ID AS NVARCHAR (20), @PLAN_HANDLE AS NVARCHAR (MAX), @PLAN_GUIDE_NAME AS NVARCHAR (128), @UNFORCE_SQL

AS NVARCHAR (MAX);

    SET @CLEARED_QUERY_HINT = '';

    DECLARE @recent_start_time AS DATETIMEOFFSET (7) = dateadd(mi, -15, getdate());

    DECLARE PLAN_HANDLE_CURSOR CURSOR LOCAL FAST_FORWARD

        FOR SELECT CAST (qsp.plan_id AS NVARCHAR (16)) AS PlanId,

                   '0x' + CONVERT (NVARCHAR (MAX), deqs.plan_handle, 2) AS PlanHandle

            FROM   sys.query_store_plan AS qsp WITH (NOLOCK)

                   INNER JOIN

                   sys.dm_exec_query_stats AS deqs WITH (NOLOCK)

                   ON (qsp.query_plan_hash = deqs.query_plan_hash)

            WHERE  qsp.query_id = @QUERY_ID

                   AND qsp.last_execution_time > DATEADD(MINUTE, -15, GETUTCDATE())

                   AND plan_for

Error SQL72014: Core Microsoft SqlClient Data Provider: Msg 207, Level 16, State 1, Procedure AutotuneEvictPlansFromCach

e, Line 32 Invalid column name 'plan_forcing_type_desc'.

Error SQL72045: Script execution error.  The executed script:

CREATE PROCEDURE [dbo].[AutotuneEvictPlansFromCache]

@QUERY_ID BIGINT, @EVICTED_PLANS NVARCHAR (MAX) OUTPUT, @CLEARED_QUERY_HINT NVARCHAR (MAX) OUTPUT

AS

BEGIN

    DECLARE @PLAN_ID AS NVARCHAR (20), @PLAN_HANDLE AS NVARCHAR (MAX), @PLAN_GUIDE_NAME AS NVARCHAR (128), @UNFORCE_SQL

AS NVARCHAR (MAX);

    SET @CLEARED_QUERY_HINT = '';

    DECLARE @recent_start_time AS DATETIMEOFFSET (7) = dateadd(mi, -15, getdate());

    DECLARE PLAN_HANDLE_CURSOR CURSOR LOCAL FAST_FORWARD

        FOR SELECT CAST (qsp.plan_id AS NVARCHAR (16)) AS PlanId,

                   '0x' + CONVERT (NVARCHAR (MAX), deqs.plan_handle, 2) AS PlanHandle

            FROM   sys.query_store_plan AS qsp WITH (NOLOCK)

                   INNER JOIN

                   sys.dm_exec_query_stats AS deqs WITH (NOLOCK)

                   ON (qsp.query_plan_hash = deqs.query_plan_hash)

            WHERE  qsp.query_id = @QUERY_ID

                   AND qsp.last_execution_time > DATEADD(MINUTE, -15, GETUTCDATE())

                   AND plan_for
 
I have the same question (0)
  • Hana Xue Profile Picture
    Microsoft Employee on at
    Issue with Importing Database(.bacpac)
    Hi,
    Not sure what the cause is, maybe you can check out similar questions about database import errors:
    sql - Msg 207, Level 16, State 1 "Invalid column name 'Name'" - Stack Overflow
    sql - Error Importing Azure bacpac file to local db error incorrect syntax near EXTERNAL - Stack Overflow
    Best Regards,
    Hana
  • Community member Profile Picture
    4 on at
    Issue with Importing Database(.bacpac)
    Thanks Martin for the response, we tried these two versions already as per the import database documentation
     
    162.1.167 SqlPackage
    162.0.52 SqlPackage
     
    we tried through visual studio 14 as well , 
    still the error is same , is there any other solution? 
  • Suggested answer
    Martin Dráb Profile Picture
    236,279 Most Valuable Professional on at
    Issue with Importing Database(.bacpac)
    Use SqlPackage.exe to import .bacpac files, as documented in Import a database.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 2,206

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 847 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 596 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans