2
Reply

What Is CTE in Sql Server 2005 ?

shaikh shahbaz

shaikh shahbaz

13y
4.9k
0
Reply

    CTE (Common Table Expression) is the new and interesting feature of SQL Server 2005.Now,CTE stores the result as temporary result set from inside a statement.CTE is used when creating tables on the fly inside a  nested select and doing recursive function.CTE can be used for select and DML statements.

    For example:

    use AdventureWorks

    go

    with MyCte( ListPrice , SellPrice) As

    {

                select ListPrice , ListPrice * .95 from Production.Product

    }

    select * from MyCte

    Hi shaikh,

    Take the reference of this article.
    http://www.c-sharpcorner.com/UploadFile/skumaar_mca/CTE200509142009094057AM/CTE2005.aspx