Home Dashboard Directory Help
Search

[Datadude] Valid CREATE VIEW syntax throws errors by Jamie Thomson


Status: 

Closed
 as Deferred Help for as Deferred


7
0
Sign in
to vote
Type: Bug
ID: 586040
Opened: 8/13/2010 3:48:09 AM
Access Restriction: Public
0
Workaround(s)
view
4
User(s) can reproduce this bug

Description

Datadude (i.e. DB tools in VS2010) is throwing erros for perfectly valid CREATE VIEW syntax.
Details
Sign in to post a comment.
Posted by Rob Lewis on 4/3/2012 at 11:17 AM
April, 2012, any word on a proper fix?
Posted by rathor on 5/2/2011 at 4:44 PM
Never mind. My bad.
Posted by rathor on 5/2/2011 at 4:31 PM
I'm getting this error w/ something as simple as this:
CREATE VIEW [affil].[BeneficiaryCompany]
AS
SELECT
    b.ID,
    b.Policy_ID,
    b.Company_ID,
    c.CompanyName,
    b.WebSubheader,
    b.Logo,
    b.LogoMimeType,
    b.LogoWidth,
    b.LogoHeight
FROM [affil].[Beneficiary] b
INNER JOIN [dbo].[Company] c ON c.ID = b.Company_ID

Error    61    SQL03006: View: [affil].[BeneficiaryCompany] 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: [affil].[Beneficiary].[b]::[Company_ID], [affil].[Beneficiary].[Company_ID] or [dbo].[kCompany].[b]::[Company_ID].

Error    62    SQL03006: Column: [affil].[BeneficiaryCompany].[Company_ID] 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: [affil].[Beneficiary].[b]::[Company_ID], [affil].[Beneficiary].[Company_ID] or [dbo].[Company].[b]::[Company_ID].    

Company_ID only exists in affil.Beneficiary (It is ID in dbo.Company).
?????
What's going on? Both tables do contain column_name "ID". There is no case where a table_name equals a column_name.


Posted by Microsoft on 10/3/2010 at 9:57 PM
Jamie,

Thank you for submitting this issue. We have reproduced this issue and have added it to our product backlog. It will be considered for a service release of Visual Studio.

This is an interpreter issue. Our interpreter gets confused on nested sub queries where the source is a dynamic or aliased table. You can often workaround the issue by simplifying the expression. Using the simplified repro you sent here is a workaround:

with cteDates ([SoFYDate],[EoFYDate])
    AS ( select getdate(), getdate())
    SELECT * FROM
            ( SELECT [cteDates].[SoFYDate] , [cteDates].[EoFYDate]
                FROM sysobjects
                    inner join [cteDates] on sysobjects.crdate >= [cteDates].[SoFYDate]) AS X

Granted, this should not be necessary if the interpreter behaved as expected.

Thanks for submitting this issue to Microsoft.

Barclay Hill

Sr. Program Manager | Visual Studio Product Team (Data Tools) | Microsoft Corporation
Posted by Tudor Turcu on 10/1/2010 at 4:32 AM
Any news on when this bug is going to be fixed?
For many people, this is a blocking issue in trying to adopt VS Team Edition for database development..
Posted by Microsoft on 8/13/2010 at 8:38 PM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)
Sign in to post a workaround.