Using SSDT, how do I resolve SQL71561 errors when I have a view that references objects in a different database?

前端 未结 5 2331
我在风中等你
我在风中等你 2020-12-09 08:22

I have a database project in SSDT and when I import a view that references objects in a different database, I get error SQL71561, with a description along these lines:

5条回答
  •  一向
    一向 (楼主)
    2020-12-09 09:05

    These errors started appearing for me when I changed the Project Properties > Target Platform from SQL Server 2016 to SQL Server 2014.

    In my scenario I have a database that is created by an external tool in one SSDT project (A) and my SQL views, etc in another project (B) with a reference from B->A.

    Having developed against SQL 2016 I found our test environment was running 2014 so changed the target platform in (B) so I could deploy. (A) isn't deployed - the external tool is also installed and configured to produce the same database.

    Strangely, I was later able to alter views in (B) and publish, but then wanted to remove a column. At this point the publish kept failing due to these reference errors. Changing the Target Platform on project (A) to 2014 then cleared the error and allowed me to proceed.

提交回复
热议问题