Errata

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.

The following errata were submitted by our customers and have not yet been approved or disproved by the author or editor. They solely represent the opinion of the customer.

Color Key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted by Date submitted
Printed Page 68
Table 5-1 Numeric Data Types

the Range of Values for real and float(n) data types should be expressed in scientific notation ...

example: 1.79 to the power of 308 is different from 1.79E+308 (or 1.79 * 10 to the power of 308)

see also:
http://msdn.microsoft.com/en-us/library/aa258271%28v=sql.80%29.aspx

Christine Muser  Jul 05, 2011 
Printed Page 70
Under "Unicode Data"

The paragraphs headed "Unicode Data" are confusing and should be clarified.

ANSI (American National Standards Institute) refers to thousands of standards, several of which deal with character representation. Microsoft's documentation indicates that by ANSI, they mean a code page, usually whichever code page is currently selected in the application. Most code pages correspond to one byte, so they encode up to 256 characters. A few code pages (DBSC - double-byte character set) support a variable-length encoding.

Table 5-3, at the top of page 70, implies that char and varchar use one-byte encodings, and nchar and nvarchar use two-byte encodings.

The book says: "Character data can be stored using either an ANSI or a Unicode character set. [At this point, I start thinking ANSI = char and Unicode = nchar.] The ANSI character set encompasses most of the characters that are used in most languages throughout the world. [I'm thinking, okay, using different code pages you can cover all but the CJK languages in one byte.] However, the ANSI character sets only encompass a little more than 32,000 characters. [What's this? You can't cover 32,000 characters in one byte. The author must be referring to the total number of characters in all the code pages. But in reality there are ten single-byte code pages, and they overlap in the range 0-127, resulting in no more than 1,400 characters.] Several languages such as Arabic, Hebrew, and some Chinese dialects contain more than 32,000 characters within the standard alphabet. [Huh? Arabic and Hebrew each have one code page of 256 characters.]"

The only way I can reconcile this is by taking "ANSI" to refer to the DBSC code pages as well as the single-byte ones. That contradicts my assumption that ANSI = char.

The next paragraph says that "either Unicode or non-Unicode" data can be stored, with Unicode data going in nchar fields and non-Unicode data presumably in char fields. Is non-Unicode the same as ANSI? If so, that blows my attempt at reconciliation out of the water. If not, I don't understand how the phrase "either an ANSI or a Unicode character set" in the first paragraph relates to this paragraph.

Gwillim Law  Oct 30, 2012 
Printed Page 82
Step 9

I have encountered several areas where the text refers to fields that do not exist in the practice files installed from the CD. For example, step 9 has the reader modify the following fields: Month Key, Calendar Quarter Key and Fiscal Quarter Key. Those fields are not in the DimDate table. Is there a site where I can download a copy of the practice files that correspond with the text?

ArtOlsen  May 24, 2011 
Printed, Other Digital Version Page 85
Create a Database Diagram

When creating the tables described in the book to this point, then creating the Database Diagram, the Database diagram does not match the partial picture of the one pictured on page 86.

Additionally, when I attempted to run the Chapter6\code1,sql script, it failed with multiple errors. In short, the required foreign keys and other elements had not been created as was evident from the Database Diagram.

I deleted all the tables from the SQL2008SBS database and ran the Chapter5\code14-mastercreationscript.sql. I was able to create a correct Database Diagram and the execution of the Chapter 6 scripts was successful

Anonymous  Aug 26, 2011 
Printed Page 92
Step 1

When executing Chapter6\code1.sql, the query completes with the following errors:

Msg 3728, Level 16, State 1, Line 3
'fk_orderheadertoorderdeatils' is not a constraint.
Msg 3727, Level 16, State 0, Line 3
Could not drop constraint. See previous errors.
Msg 1769, Level 16, State 1, Line 2
Foreign key 'fk_orderheadertoorderdetails' references invalid column 'OrderID' in referencing table 'OrderDetail'.
Msg 1750, Level 16, State 0, Line 2
Could not create constraint. See previous errors.

Anonymous  Oct 12, 2011 
Printed Page 132
2nd paragraph

Re code example:

There is no object called Person.Contact on the AdventureWorks2008 sample database. Nor is there a column 'title' on HumanResources.Employee. I suggest the intention is to produce a list of names and their corresponding Job Title e.g.

SELECT a.FirstName, a.LastName, b.JobTitle
FROM Person.Person a LEFT OUTER JOIN HumanResources.Employee b on a.BusinessEntityID = b.BusinessEntityID

(n.b code sample for this on the CD used an INNER JOIN but that's by the by)


Graham Pretty  Nov 05, 2012 
PDF Page 141
5th paragraph

The text says that "if the NULL corresponds to the aggregation of NULLs in the source data, the result of the GROUPING function will be 1". It should say the grouping function will be 0. In the next sentence the grouping function should be 1.

Anonymous  Feb 29, 2012 
Printed Page 163
exercise #4


you will get an error when trying to insert records into the Archive Orderheader and OrderDetails tables.
You are trying to insert a value to the identity column. So you need to
turn on the IDENTITY_INSERT on and then off for each table.
so updated code below.

set IDENTITY_INSERT Archive.OrderHeader on
INSERT INTO Archive.OrderHeader
(OrderID, CustomerID, OrderDate, SubTotal, TaxAmount, ShippingAmount, FinalShipDate)
SELECT OrderID, CustomerID, OrderDate, SubTotal, TaxAmount, ShippingAmount, FinalShipDate
FROM Orders.OrderHeader
WHERE FinalShipDate IS NOT NULL
set IDENTITY_INSERT Archive.OrderHeader OFF
GO

set IDENTITY_INSERT Archive.OrderDetail on
INSERT INTO Archive.OrderDetail
(OrderDetailID, OrderID, SKU, Quantity, UnitPrice, ShipDate)
SELECT a.OrderDetailID, a.OrderID, a.SKU, a.Quantity, a.UnitPrice, a.ShipDate
FROM Orders.OrderDetail a INNER JOIN Orders.OrderHeader b ON a.OrderID = b.OrderID
WHERE b.FinalShipDate IS NOT NULL
set IDENTITY_INSERT Archive.OrderDetail OFF
GO

Robert Sullivan  Mar 30, 2012 
Other Digital Version 335
Bottom

The code for script Chap6\code1 fails with errors because constraints do not exist. Nor can you run Chap5\code14-mastercreationscript because it does not drop the tables or the constraints before creating them.

Claude D Cornish III  May 23, 2011