I created a new SQL Server Database Project within VS 2010, imported the database objects and settings from a local database named “managers”, and received the following error while attempting to build the project:
SQL03006: View: [dbo].[vw_mlFunds] has an unresolved reference to object [managers].[dbo].[mlfunds].
I don’t know why this view is fully qualifying a table reference to include the actual database name and I would prefer not to have to change the sql, as it someone else’s code and it technically is not incorrect. But I am thinking that fully qualifying the table name to include the name of the database is confusing the VS compiler, since it is expecting [dbo].[mlfunds], not [managers].[dbo].[mlfunds]. How best to resolve this issue? Can I set up a new database name variable/alias somewhere? Or will I have to refactor/modify the sql to get it to compile? Thanks in advance.
Actually, it looks like the code will have to be modified, as this is not supported. Answer found in this post:
Using local 3-part names in programmability objects