• Chris Morris (1/5/2009)


    Philip Horan (1/5/2009)


    Chris I was just playing with the CTE concept as I am quite new to TSQL.

    Moving forward part of the learning process is to know when to employ the correct method as a solution for the problem.

    Many thanks for your input.

    Phil

    Phil,

    Best way to learn is to play. I'd never considered using a CTE in an UPDATE before, but right there's a new challenge - to find a scenario where a CTE is the right way to go. I reckon someone will post one within a day or so.

    See that Update solution that I just posted in the "Cursors Be Gone" thread. It's got a derived table, that arguably could/should be a CTE: http://www.sqlservercentral.com/Forums/FindPost630181.aspx

    [font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
    Proactive Performance Solutions, Inc.
    [/font]
    [font="Verdana"] "Performance is our middle name."[/font]