Microsoft® SQL Server® 2008 Step by Step

Errata for Microsoft® SQL Server® 2008 Step by Step




The errata list is a list of errors and their corrections that were found after the product was released. If the error was corrected in a later version or reprint the date of the correction will be displayed in the column titled "Date Corrected".

The following errata were submitted by our customers and approved as valid errors by the author or editor.

Color Key: Serious Technical Mistake Minor Technical Mistake Language or formatting error Typo Question Note Update



Version Location Description Submitted By Date Submitted Date Corrected
Printed
Page 20
Note Section

On page 20 on the note section the author states only enterprise edition of SQL Server 2008 supports multiple editions. However according to the msdn you can have 50 instances of a stand-alone server for all SQL Server editions. Or it will support 25 instances in a cluster. I am also posting a link to where I found this. http://msdn.microsoft.com/en-us/library/ms143432%28SQL.105%29.aspx Under Instances Per Computer

Note from the Author or Editor:
Please change to: SQL Server 2008 supports a maximum of 25 instances in a cluster.

Josh Stephens  Dec 26, 2010  May 20, 2011
Printed
Page 44
1st pargraph

There is a link which is inaccessible and I cannot seem to find it. The link is: www.microsoft.com/learning/books/online/serverclient The paper we are supposed to look for ois "Performance Analysis Tools".

Note from the Author or Editor:
Please remove the following text. It points at a location that is no longer valid and I can't find the location that the document has moved to. " You will learn about Profiler in the article, “Performance and Data Capture Tools,” which can be found on the Microsoft Press Online Windows Server and Client Web site at www.microsoft.com/learning/books/online/serverclient."

Mark Inman  Sep 06, 2010  May 20, 2011
Safari Books Online
70 in online version, p. 73 in printed version
Create an XML Schema Collection, Step 1

in the xsd:schema opening tag, the urls need to be inclosed in quotes.

Note from the Author or Editor:
Please change to the following: CREATE XML SCHEMA COLLECTION ProductAttri butes AS ' <xsd:schema xmlns:schema="PowerTools" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:sql types="http://schemas.microsoft.com/sqlserver/2004/sqltypes"

Anonymous  Oct 19, 2010  May 20, 2011
Safari Books Online
70
table 5-3

the table says nchar(n) and nvarchar(n) data types support a maximum of 4000 bytes. It should be 4000 characters (or 8000 bytes).

Note from the Author or Editor:
Please change 4000 bytes to 8000 bytes in table 5-3 after nchar(n) and nvarchar(n)

Anonymous  Oct 19, 2010  May 20, 2011
Other Digital Version
81
code to add primary keys to existing tables

On page 81 code is mentioned to add primary keys to existing tables. The code on the companion CD is wrong (a primary key for HumanResources.EmployeeAddress already exists): Wrong: USE SQL2008SBS GO ALTER TABLE Orders.OrderDetail ADD CONSTRAINT pk_orderdetail PRIMARY KEY (OrderDetailID) GO ALTER TABLE Products.Product ADD CONSTRAINT pk_product PRIMARY KEY (ProductID) GO ALTER TABLE HumanResources.Employee ADD CONSTRAINT pk_employee PRIMARY KEY (EmployeeID) GO ALTER TABLE HumanResources.EmployeeAddress ADD CONSTRAINT pk_employeeaddress PRIMARY KEY (AddressID) GO Correct: USE SQL2008SBS GO ALTER TABLE Orders.OrderDetail ADD CONSTRAINT pk_orderdetail PRIMARY KEY (OrderDetailID) GO ALTER TABLE Products.Product ADD CONSTRAINT pk_product PRIMARY KEY (ProductID) GO ALTER TABLE HumanResources.Employee ADD CONSTRAINT pk_employee PRIMARY KEY (EmployeeID) GO

Note from the Author or Editor:
Please correct the code on the CD to the corrected version provided by the reader as shown above.

Anonymous  Mar 16, 2010 
Safari Books Online
81
Create a Table with a Unique Constraint, step 1

on page 78 you give the note: Note: Unless a different database name is explicitly speci&#64257;ed, you should assume that all of the queries you execute will occur against the SQL2008SBS database. On page 81 you say to execute: CREATE TABLE Products.ProductDocument (DocumentID UNIQUEIDENTIFIER ROWGUIDCOL UNIQUE, DocumentType VARCHAR(20) NOT NULL, Document VARBINARY(MAX) FILESTREAM NULL, CONSTRAINT pk_productdocument PRIMARY KEY(DocumentID)) GO which generates the error: Msg 1969, Level 16, State 1, Line 1 Default FILESTREAM filegroup is not available in database 'SQL2008SBS'. the FILESTREAM filegroup is available in the SQL2008SBSFS database, but that database doesn't have the Products Schema, so the statement would fail there also.

Note from the Author or Editor:
Please change to the following: 1. Execute the following code against the SQL2008SBSFS database to add a Products.ProductDocument table (the code is from the Chapter5\code10.sql &#64257;le in the book’s accompanying samples):

Anonymous  Oct 20, 2010  May 20, 2011
Printed
Page 81
Bottom of page

In executing the .sql example Chaper5\code10.sql USE SQL2008SBSFS GO CREATE TABLE Products.ProductDocument (DocumentID UNIQUEIDENTIFIER ROWGUIDCOL UNIQUE, DocumentType VARCHAR(20) NOT NULL, Document VARBINARY(MAX) FILESTREAM NULL, CONSTRAINT pk_productdocument PRIMARY KEY(DocumentID)) GO get the following error Msg 2760, Level 16, State 1, Line 2 The specified schema name "Products" either does not exist or you do not have permission to use it. All prior code1.sql thru code9.sql executed properly

Note from the Author or Editor:
Script should be changed to the following: USE SQL2008SBSFS GO CREATE SCHEMA Products AUTHORIZATION dbo GO CREATE TABLE Products.ProductDocument (DocumentID UNIQUEIDENTIFIER ROWGUIDCOL UNIQUE, DocumentType VARCHAR(20) NOT NULL, Document VARBINARY(MAX) FILESTREAM NULL, CONSTRAINT pk_productdocument PRIMARY KEY(DocumentID)) GO

edrokosz  Jan 25, 2011  Dec 16, 2011
Printed, Safari Books Online
Page 93
last sentence before Index Maintenance title

The books says the limit of non-clustered index is 249, as it is now 999 in SQL Server 2008.

Note from the Author or Editor:
Please change 249 to 999. " The other type of relational index that can be created is a nonclustered index. Nonclustered indexes do not impose a sort order on the table, so you can create multiple nonclustered indexes on a table. Nonclustered indexes have the same restrictions as a clustered index—maximum of 900 bytes and maximum of 16 columns, along with additionally being limited to a maximum of 999 nonclustered indexes on a table."

Franck Boisdé  Nov 05, 2010  May 20, 2011
Printed
Page 125
The example for the case function

The example for the case function will not work like explained as A.Datum will still be displayed for all cases where ShipMethodID has a value of 4. Wrong: SELECT ShipMethodID, CASE WHEN ShipMethodID = 2 THEN 'Contoso' WHEN ShipMethodID = 3 THEN 'Consolidated Messenger' WHEN ShipMethodID >= 2 AND ShipMethodID <= 4 THEN 'A.Datum' ELSE 'Unknown' END ShipMethod FROM Purchasing.PurchaseOrderHeader GO Correct SELECT ShipMethodID, CASE WHEN ShipMethodID = 2 THEN 'Contoso' WHEN ShipMethodID = 3 THEN 'Consolidated Messenger' WHEN ShipMethodID >= 2 AND ShipMethodID <= 3 THEN 'A.Datum' ELSE 'Unknown' END ShipMethod FROM Purchasing.PurchaseOrderHeader GO

Note from the Author or Editor:
Please change query to the corrected version supplied by the reader above.

Anonymous  Mar 24, 2010  May 20, 2011
Printed
Page 144
6th paragraph (3rd query statement)

this query is attemping to return orders greater than $45,000. However, it uses the SalesOrderId in the WHERE clauses, which will return the all SalesOrderIds over 45000 instead of sum of the LineTotal over $45,000. I would certainly like to know what the author intended. Thanks, Lee

Note from the Author or Editor:
This is a typographical mistake. Please remove the $ sign as it should not exist in the paragraphs. As follows: Although this query shows an aggregate in the HAVING clause, you can use either aggregate or nonaggregate columns in the HAVING clause. If you wanted to return the order total for all sales orders greater than 45,000, you could execute the following query and return valid results. SELECT SalesOrderID, SUM(LineTotal) AS SubTotal FROM Sales.SalesOrderDetail GROUP BY SalesOrderID HAVING SalesOrderID > 45000 ORDER BY SalesOrderID ; Although the previous query would return the correct results, it is extremely inef&#64257;cient. SQL Server would calculate the order subtotal for all orders and then &#64257;lter out every order ID less than 45,000. If you are going to &#64257;lter out orders less than 45,000, there isn’t any reason to spend the resources on the machine to calculate an aggregate for rows that you are not going to return. For this reason, you shouldn’t be placing nonaggregate columns in the HAVING clause. The most ef&#64257;cient way of satisfying the requirements for orders greater than 45,000 is to use a WHERE clause which will &#64257;lter out all of the order IDs less than 45,000 before SQL Server calculates the aggregate. SELECT SalesOrderID, SUM(LineTotal) AS SubTotal FROM Sales.SalesOrderDetail WHERE SalesOrderID > 45000 GROUP BY SalesOrderID ORDER BY SalesOrderID ;

lee granger  Nov 21, 2010  May 20, 2011
Printed, PDF, Safari Books Online, Other Digital Version
Page 310
2nd paragraph

SIMPLE recovery model is like BULK LOGGED recovery model. Please change paragraph to the following: The third recovery model is SIMPLE. A database in simple recovery model logs operations to the transaction log exactly like bulk logged recovery model. However, each time the database checkpoint process executes, the committed portion of the transaction log is discarded. A database in simple recovery model cannot be recovered to a point in time, because it is not possible to issue a transaction log backup for a database in simple recovery model.

Mike Hotek
O'Reilly Author 
May 17, 2011  May 20, 2011