view calling a view problem

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Patrick (psully_at_nospam.eatel.net)
Date: 01/25/05


Date: Mon, 24 Jan 2005 20:58:53 -0600

I have this view:

CREATE VIEW CautionDescriptions AS
SELECT TOP 100 PERCENT
     Oils.OilName AS [Oil name], COALESCE(Cautions.Description, 'No
description available') AS Caution
FROM Cautions
INNER JOIN OilCautions ON Cautions.CautionID = OilCautions.CautionID
RIGHT OUTER JOIN Oils ON OilCautions.OilID = Oils.OilID
ORDER BY Oils.OilName

I want to reference OilCautions.OilID from the above view in another view.
But query analyzer tells me there's no such column. In EM the only columns
that show up in view designer are Description and Oilname.

Does a view that calls another view only have access to the output columns
of the 1st view? I need to access OilId, so do I need to put it in the 1st
view, too? If that's true, can I hide that column, make it there but
invisible? :)

TIA!
patrick



Relevant Pages

  • Re: view calling a view problem
    ... You can only reference columns in a view that are in the SELECT list. ... > CREATE VIEW CautionDescriptions AS ... > INNER JOIN OilCautions ON Cautions.CautionID = OilCautions.CautionID ... I need to access OilId, so do I need to put ...
    (microsoft.public.sqlserver.programming)
  • rename NULL column outputs
    ... CREATE VIEW CautionDescriptions AS ... INNER JOIN OilCautions ON Cautions.CautionID = OilCautions.CautionID ... RIGHT OUTER JOIN Oils ON OilCautions.OilID = Oils.OilID ... Where could I put this in the SELECT or FROM clause? ...
    (microsoft.public.sqlserver.programming)
  • Re: rename NULL column outputs
    ... You can also use ISNULL. ... > CREATE VIEW CautionDescriptions AS ... > INNER JOIN OilCautions ON Cautions.CautionID = OilCautions.CautionID ... > RIGHT OUTER JOIN Oils ON OilCautions.OilID = Oils.OilID ...
    (microsoft.public.sqlserver.programming)