May 4, 2010 at 10:41 am
Are CTE's usually created by the DBA or the Developer? I am new to CTE's, and since they don't appear to be stored or built into the database, it almost looks like the CTE should be created by the Developer for the needs of the application. Is this typical in a shop?
May 4, 2010 at 12:09 pm
A CTE is just a part of the query that needs it. As a matter of fact, a CTE must be consumed by the very next statement and can't be used in multiple statements within a query (and yes, before anyone corrects me, I know about nesting CTE's & recursion). So, who writes your stored procedures and queries now? Those same people will have CTE's available to use as appropriate.
"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
May 5, 2010 at 7:59 am
reefshark (5/4/2010)
Are CTE's usually created by the DBA or the Developer?
it has nothing to do with developer or DBA , the person whoi knows/wants to work on TSQL , can work on it.
-------Bhuvnesh----------
I work only to learn Sql Server...though my company pays me for getting their stuff done;-)
May 5, 2010 at 8:08 am
A CTE, despite its name, is not a table. It's a named select statement. Think of it as a temporary view, defined and used within the same SQL query.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply