CTE/View definition

  • Hi

    How to change the view definition ?

    I have a table with all columns having not null values when I create a view on this my all columns are not null for the view. while as if i use a common table expression to get the data from same table and create a view on top of the CTE . My view definition is displaying Null as default value .

    How i can change this CTE view definition so that it will show not null as view definition.

  • amit_adarsh (7/4/2011)


    Hi

    How to change the view definition ?

    I have a table with all columns having not null values when I create a view on this my all columns are not null for the view. while as if i use a common table expression to get the data from same table and create a view on top of the CTE . My view definition is displaying Null as default value .

    How i can change this CTE view definition so that it will show not null as view definition.

    Gosh... I guess I really don't understand the question. Views can't have cannot have column defaults... only code.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.
    "Change is inevitable... change for the better is not".

    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)
    Intro to Tally Tables and Functions

  • Use ISNULL() to assign a non-NULL value?? :ermm:



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • usually when i have this issues , dropping and re-creating the view seems to solve it.

    unless the CTE is manipulating the column in some way it should have the same defaults as the source table

Viewing 4 posts - 1 through 3 (of 3 total)

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