Up till now I have been working directly on SQL Server instances, and am now playing around with how best to keep databases in source control. The visual studio database project seems to be exactly what I want.

However, on trying to build a fairly small database I get several hundred SQL71561 errors. The code is this:

CREATE VIEW [dbo].[View Name] AS
    DbName.dbo.TableName EA

And the error is this:

SQL71561: View: [dbo].[View name] 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:
[DbName].[dbo].[TableName].[colName] or [DbName].[dbo].[TableName].[EA]::[colName].

If I add an AS to the table alias, then the code seems to be accepted. It seems that column aliases are allowed to skip the 'AS' keyword.


1 Answer 1


I think this is happening because you're qualifying the database name in the query.

So remove **DBName** form the select clause; Visual Studio would then accept it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.