Summary


There may be several ways to write some queries. Although there are some basic rules and guidelines to follow, the best approach will often depend on a number of factors including the volume of data, complexity of the database, and your business rules. Subqueries allow a SELECT statement to feed values or rows to another query. Subqueries can be scalar, single-value expressions, or nested rowset expressions. Joins can be implemented using subqueries rather than ANSI join syntax. Although often more complex and less efficient than standard joins, subquery joins can be used to process specialized business logic. If given the choice between standard join syntax and subqueries, you should typically favor standard joins. In any case, you can test your queries for performance and efficiency using graphical execution plans, SQL Profiler, System Monitor, and other benchmarking and tuning tools. The results are often surprising. Overall, be open to different ways to solve business problems. Try different forms of queries and explore various query expressions and techniques. Taking time to experiment, you will either confirm that you are using the best approach or find a better way to solve the problem.




Beginning Transact-SQL with SQL Server 2000 and 2005
Beginning Transact-SQL With SQL Server 2000 and 2005
ISBN: 076457955X
EAN: 2147483647
Year: 2006
Pages: 131
Authors: Paul Turley

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net