I am trying to add a view to a Sql Server Database Project in VS 2015. The view references two tables, which are NOT defined in the project. So, my view DDL looks like this:
CREATE VIEW [dbo].[My_View]
AS select a.Name, b.Name
from [dbo].[TableA] a
join [dbo].[TableB] b
on a.Ref = b.Ref
Neither TableA, nor TableB exists in the Database project, but they both exist in the target database. I don't want to add them to the project, because they belong to different application and should not be controlled by this particular project as it only defines a subset of tables/views in the target database.
I can't compile my project because of the error:
Error: SQL71501: View: [dbo].[My_View] has an unresolved reference to object [dbo].[TableA].
(And some further errors from the same root cause)
I tried adding a reference to master db - no luck.
Is there any way to circumvent this error? Or maybe somehow add a reference to the TableA and TableB to the project without actual DDL defining these tables?