I want to know what is Common Table Expression in SQL Server ?
Thank you.
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Jignesh TrivediPosted Jul 16, 2012, 12:17 AM
A common table expression (CTE) can be thought of as a temporary result set that is defined within the execution scope of a single SELECT, INSERT, UPDATE, DELETE, or CREATE VIEW statement. A CTE is similar to a derived table in that it is not stored as an object and lasts only for the duration of the query.Unlike a derived table, a CTE can be self-referencing and can be referenced multiple times in the same query.
Please refer
http://blogs.msdn.com/b/sqlcat/archive/2011/04/28/optimize-recursive-cte-query.aspx
http://www.4guysfromrolla.com/webtech/071906-1.shtml
hope this will help you.
Satyapriya NayakPosted Jul 15, 2012, 7:22 AM
Please refer the below links
http://www.codeproject.com/Articles/275645/CTE-In-SQL-Server
http://msdn.microsoft.com/en-us/library/ms190766%28v=sql.105%29.aspx
http://www.simple-talk.com/sql/t-sql-programming/sql-server-cte-basics/
http://www.simple-talk.com/sql/t-sql-programming/sql-server-2005-common-table-expressions/
Thanks
Santhosh Kumar JayaramanPosted Jul 15, 2012, 5:03 AM
http://www.c-sharpcorner.com/uploadfile/skumaar_mca/common-table-expressioncte-in-sql-server-2005/
also please look into this for more details.
http://www.codeproject.com/Articles/265371/Common-Table-Expressions-CTE-in-SQL-SERVER-2008