ISNULL in view

  • trying to put a ISNULL in a view to caputure bad data and replace with proper flag but getting Create View or Function failed because no column name was specified for column error.  Is this possible and I have wrong syntac?

    example:

    ALTER   VIEW dbo.vwEmp

    AS

    SELECT DISTINCT

       isnull(E.Attempt,'A')

     FROM  tblEmp E WITH (NOLOCK)

     

    NEVER MIND....i FORGOT TO ENTER ATTEMPT AFTER THE BRACKETS......How do I delete this post?

  • Try this.

     

    ALTER   VIEW dbo.vwEmp

    AS

    SELECT DISTINCT

       isnull(E.Attempt,'A') AS Attempt

     FROM  tblEmp E WITH (NOLOCK)

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply