We have a SQL 2019 database where all table names are fully qualified in views starting with the database name. We do NOT have the option of avoiding the fully qualified reference as the view definition is auto-generated (otherwise I would simply not fully qualify them). When views are defined by referencing tables within the same database as the view, the SSDT project complains that it has an unresolved reference.
Visual Studio does not allow adding a database reference to itself. The only way I can get it to compile is to create a DACPAC of the same database and then add that as a reference along with removing the database variable ($Name).
Is there any other method of providing fully qualified table names in views without having to create a DACPAC in SSDT project?
You can't use 3-4 part naming in SSDT normally. You can workaround this by using variables in the code. So let's say, that you have
[localhost].[reports].[dbo].[your_table]
you'll need to use[$(ReportServer)].[$(ReportDatabase)].[dbo].[your_table]
.