Home Forums SQL Server 2012 SQL Server 2012 - T-SQL What is wrong with this syntax? Query will work, but CTE will not "compile" RE: What is wrong with this syntax? Query will work, but CTE will not "compile"

  • Tobar (4/8/2014)


    Arrgh. Sorry. I keep thinking those are input parameters, not output.

    Another issue I had is that you can not just "compile" (execute) a CTE definition by itself without some follow on expressions. :Whistling:

    Joke?

    If not, that's because a CTE is just a query, a derived table, no different than if you did a SELECT FROM a SELECT FROM. The CTE only exists within the context of it's following statement.

    If it was a joke, sorry for getting pedantic.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning