Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Suggested answer

Issue with Importing Database(.bacpac)

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
 
  • Hana Xue Profile Picture
    Hana Xue 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
  • 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
    Martin Dráb 230,056 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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

New! Quick response templatesâš¡

Save time with the new custom templates!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,228 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,056 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans