?
Solved

Where we are going to use "Derived Tables" (In which scenario they are mandatory) ?

Posted on 2008-11-09
3
Medium Priority
?
242 Views
Last Modified: 2012-05-05
Hi,

Can you please let me know in which scenarios derived tables are mandatory to use ?

Thanks
0
Comment
Question by:milani_lucie
3 Comments
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 22917376
from syntax point of view, they are not "mandatory". you could always solve the problem with temp tables.
from performance point of view, they are very useful and powerful.
0
 
LVL 17

Accepted Solution

by:
HoggZilla earned 1500 total points
ID: 22917383
Agreed, I prefer the use of derived but not required.
http://www.sqlservercentral.com/articles/DerivedTables/61388/ 
0
 
LVL 22

Expert Comment

by:dportas
ID: 22917500
A "derived table" is a syntax for creating a temporary name (alias) for a table expression within the scope of a single query. It is used mainly to simplify the SQL by using the name instead of repeating a complex expression.

The only time I can think of when derived tables are essential is for recursive queries (recursive CTEs). A recursive CTE (Common Table Expression) is a special kind of derived table.
0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Integration Management Part 2

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question