2
Reply

What Is CTE in Sql Server 2005 ?

shaikh shahbaz

shaikh shahbaz

Feb 09, 2011
4.9k
0

    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

    sarika jain
    February 11, 2011
    0

    Hi shaikh,

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

    Manish Dwivedi
    February 10, 2011
    0