Beginning Transact-SQL with SQL Server 2000 and 2005
Transact-SQL is a powerful implementation of the ANSI standard SQL database query language. In order to build effective database applications, you must gain a thorough understanding of these features. This book provides you with a comprehensive introduction to the T-SQL language and shows you how it can be used to work with both the SQL Server 2000 and 2005 releases.
Beginning with an overview of the SQL Server query operations and tools that are used with T-SQL, the author goes on to explain how to design and build applications of increasing complexity. By gaining an understanding of the power of the T-SQL language, you'll be prepared to meet the ever-increasing demands of programming.
What you will learn from this book
- How T-SQL provides you with the means to create tools for managing hundreds of databases
- Various programming techniques that use views and stored procedures
- Ways to optimize query performance
- How to create databases that will be an essential foundation to applications you develop later
Who this book is for
This book is for database developers and administrators who have not yet programmed with Transact-SQL. Some familiarity with relational databases and basic SQL is helpful, and some programming experience is helpful.
Wrox Beginning guides are crafted to make learning programming languages and technologies easier than you think, providing a structured, tutorial format that will guide you through all the techniques involved.
Chapter 1: Introducing Transact-SQL and Data Management Systems.
Chapter 2: SQL Server Fundamentals.
Chapter 3: Tools for Accessing SQL Server.
Chapter 4: Introducing Transact-SQL Language.
Chapter 5: Data Retrieval.
Chapter 6: SQL Functions.
Chapter 7: Aggregation and Grouping.
Chapter 8: Multi-Table Queries.
Chapter 9: Data Transactions.
Chapter 10: Advanced Queries and Scripting.
Chapter 11: Full-Text Index Queries.
Chapter 12: Creating and Managing Database Objects.
Chapter 13: Transact-SQL Programming Objects.
Chapter 14: Transact-SQL in Applications and Reporting.
Appendix A: Command Syntax Reference.
Appendix B: System Variables and Functions Reference.
Appendix C: System Stored Procedure Reference.
Appendix D: Information Schema Views Reference.
Appendix E: Answers to Exercises.
Paul designed and maintains www.Scout-Master.com, a web-based service that enables Boy Scouts and their leaders to manage their own unit web sites, membership, and advancement records on-line using SQL Server and ASP.NET. Paul has been a contributing or lead author on Professional SQL Server Reporting Services (1st and 2nd editions), Beginning Access 2002 VBA, Professional SQL Server 2000 Data Warehousing with Analysis Services, and Professional Access 2000 Programming from WROX Press.
Dan Wood (Silverdale, WA) is the Operations Manager, Database Administrator, and SQL Server Trainer for Netdesk Corporation, a Microsoft Gold Certified Partner for Learning Solutions in Seattle where he manages and develops database solutions as well as trains database professionals from organizations throughout the Northwest. He has been a Microsoft Certified Professional and Trainer since 1999 and currently holds his MCDBA, MCSD, and MCSE certifications.
|Adventure Works Cycles Database 2000
This database was reproduced by John Wiley and Sons, Inc. under special permission from Microsoft Corporation. For this reason, John Wiley and Sons, Inc. is responsible for its warranty. DO NOT CONTACT MICROSOFT CORPORATION FOR SOFTWARE SUPPORT. This product is provided for free, and no support is provided for by John Wiley and Sons, Inc. or Microsoft Corporation.
|20.17 MB||Click to Download|
Do you think you've discovered an error in this book? Please check the list of errata below to see if we've already addressed the error. If not, please submit the error via our Errata Form. We will attempt to verify your error; if you're right, we will post a correction below.
The link in the book is wrong. I could not locate AdventureWorks2000 sample database for download.
The above link does not work....
It should be the following:
|99-100||Error in Figure Position
Figure 3-56 was placed on the wrong page, after the next section heading. The figure numbers are correct but the placement of this figure is incorrect.
|114||Error in Code
in last line of code:
|177||Error in Code
SELECT DATEADD( mi, -9000000, '4-29-1988 10:30 AM')
SELECT DATEADD( ms, -9000000, '4-29-1988 10:30 AM')
|390||Error in Function
Top of the page:
calling function dbo.fnFirstName
calling function fnGetName
(as created in previous example)
|529||Error in Solution
The solution script printed at the bottom of page 529 is not relevant to the exercise. The correct solution should read as follows:
SELECT * FROM
(SELECT TOP 10 FirstName + ' ' + LastName AS Name, BaseRate
FROM Employee ORDER BY BaseRate DESC) AS E1
SELECT * FROM
(SELECT '(Other)' AS Name, AVG(Employee.BaseRate) AS BaseRate
LEFT OUTER JOIN
(SELECT TOP 10 EmployeeID, BaseRate FROM Employee ORDER BY BaseRate DESC) AS E2
ON Employee.EmployeeID = E2.EmployeeID
WHERE E2.EmployeeID IS NULL) AS E3