I created a Database project by importing a schema from an existing database. In the project I am creating stored procedures that merge data with another database… My issue is that I get a ton of Warnings on the data from the referenced database. Below I will include screenshots and the offending procedure
Stored Procedure
CREATE PROCEDURE [dbo].[GetContact]
@ContactID [int]
AS
BEGIN
SET NOCOUNT ON;
SELECT
FirstName = COALESCE(a.FirstName, b.first_name),
LastName = COALESCE(a.LastName, b.last_name),
Organization = COALESCE(a.Organization, b.company),
LanguageTypeID = COALESCE(a.LanguageTypeID, (CASE WHEN b.default_language = 'Spanish' THEN 3 ELSE 2 END))
FROM [dbo].[Contact] AS a
FULL OUTER JOIN [OldDB].[dbo].[contacts] AS b
ON a.ContactID = b.contact_identification_number
WHERE a.ContactID = @ContactID
END
Visual Studio
Schema Explorer

Error List

Warning 12 SQL04151: Procedure: [dbo].[GetContact] contains an unresolved reference to an object. Either the object does not exist or the reference is ambiguous because it could refer to any of the following objects: [dbo].[Contact].[b]::[Default_Language], [*].[dbo].[Students].[b]::[Default_Language] or [*].[dbo].[Students].[Default_Language]. c:\users\*\documents\visual studio 2010\projects\TED\TED\Schema Objects\Schemas\dbo\Programmability\Stored Procedures\dbo.GetContact.proc.sql 21 52 TED
Any thoughts as to how I can reference another schema to get rid of these warnings so I can focus on real issues?
Your database project doesn’t know the the other databases of you server like “OldDB”. You should define a Database Cross Reference in the Project Properties.
See the explanation here: http://publicityson.blogspot.com/2009/11/using-database-project-cross-database.html