Errata

MCTS Self-Paced Training Kit (Exam 70-433): Microsoft® SQL Server® 2008 - Database Development

Errata for MCTS Self-Paced Training Kit (Exam 70-433): Microsoft® SQL Server® 2008 - Database Development

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
Other Digital Version CDROM
Practice Test question

Regarding the CD-ROM, for this question:

"You want to turn on tab completion with Microsoft Windows
PowerShell. Which command should you execute?", the correct answer mentioned was:

$SqlServerIncludeSystemObjects


The explanation was:

To enable tab completion, the
$SqlServerIncludeSystemObjects property
should be set to $True. The following code does this correctly:

$SqlServerIncludeSystemObjects



The question is incorrect, because tab-completion is ALREADY enabled. However, what's not enabled is the display of system objects. So the question should instead read -
?You want to turn on tab completion for system objects with Microsoft Windows PowerShell. Which command should you execute?

Also, the answer is not correct since
typing "$SqlServerIncludeSystemObjects" by itself will not enable it. It is enabled only if it is set to $True. So the answer should be:
$SqlServerIncludeSystemObjects = $True

Anonymous  Mar 09, 2011 
Other Digital Version CDROM
Practice Test question

I found one incorrect(or at least partially incorrect) answer in the practice test

The question:
"You are inserting data into a table that uses an INSTEAD OF trigger to validate data before adding it to the table.
If the data is not valid, it is not inserted into the table. You must run an INSERT statement and return a list of rows that were validated and added to the table.
What should you do?"

The answer marked as correct:
"Create a table variable to store the inserted rows. Use an
OUTPUT INTO clause in the INSERT statement to populate the table variable with the inserted rows. Execute a SELECT statement that returns all rows that are in both the table and the table variable."

Unfortunately, the proposed solution works only for a limited
number of cases: Table must have an unique index or Primary Key
must not be an auto generated number. If, for example, table has a
primary key defined as IDENTITY column (which is quite common
practice), OUTPUT will insert 0(because of INSTEAD OF trigger) into
appropriate column of table variable. In turn, it makes almost
impossible(in some cases absolutely impossible) to join the table
variable and the table. Even when it's possible it requires extra
steps between issuing INSERT .. OUTPUT INTO and SELECT statements.

In my opinion, table structure limitations should be
stated in the question; otherwise, the only reliable way to get
inserted rows is to
"Create a table variable and populate it with the
contents of the table. Insert the new data into the table.
Execute a SELECT statement that returns all rows that are in the table but not in the table variable."

Anonymous  Jun 02, 2011 
Other Digital Version ?
CDROM Practice Test question

4th (and correct) answer has a typo. There is a missing open bracket.

Question starts:
You use a table named Orders to track the purchase orders paid by your company. The table includes the following columns:

* department, which indicates the department that made the order
* orderDate, which stores the date of the order
* cost, which stores the cost of the order

You must write a short query to retrieve the following:

* The total cost of all purchase orders for each department
* The total cost of all purchase orders for each department on each day that orders were made
* The total cost of all purchase orders across all departments on each day that orders were made
* The total cost of all purchase orders across all departments

Which query should you use?

The 4th answer should read:
SELECT orderDate, department, SUM(cost)
FROM Orders
GROUP BY
GROUPING SETS
(department, (department, orderDate), orderDate, ());

Anonymous  Mar 19, 2012 
Other Digital Version NA
Random question

The test exam question "Your company uses a table named Products that contains product information. You are migrating the product information to a new table named NewProducts. Each table contains a column named id that stores the unique product ID number. You must remove all products from the Products table that have already been entered into the NewProducts table.

From the list on the right, select the elements of the statement you should use. Place your selections in the list on the left in the order in which they appear in the statement. Place your selections in the list on the left by clicking the items in the list on the right and clicking the arrow button. You can also use the up and down buttons to rearrange items in the list on the left. You may not need to use all the items from the list on the right." has what appears to be an incorrect answer.

The answer given is;

DELETE
from Products as P1
From NewProducts as P2
WHERE
p1.id = P2.id

I believe the correct answer should be

delete products
from products p1
join newproducts p2
on
p1.id = p2.id

(This answer works.......)

Stan Gifford  Jul 26, 2012 
Other Digital Version NA
Random question

The test exam question "Your company uses a table named Products that contains product information. You are migrating the product information to a new table named NewProducts. Each table contains a column named id that stores the unique product ID number. You must remove all products from the Products table that have already been entered into the NewProducts table.

From the list on the right, select the elements of the statement you should use. Place your selections in the list on the left in the order in which they appear in the statement. Place your selections in the list on the left by clicking the items in the list on the right and clicking the arrow button. You can also use the up and down buttons to rearrange items in the list on the left. You may not need to use all the items from the list on the right." has what appears to be an incorrect answer.

The answer given is;

DELETE
from Products as P1
From NewProducts as P2
WHERE
p1.id = P2.id

I believe the correct answer should be

delete products
from products p1
join newproducts p2
on
p1.id = p2.id

(This answer works.......)

Stan Gifford  Jul 26, 2012 
Printed Page 80,119,319,372,426
Found within 'Take a Practice Test'

Nearly every chapter states on the pages listed above that the practice tests will allow you to:
"...test yourself on just the content covered in this chapter..."

Yet, when the practice test is opened there are no options to choose individual chapters. Typo? This ability to test per chapter is one of the books upfront selling points in my oppinion.

Sean Cottrille  Sep 23, 2010 
PDF Page 87
2nd Paragraph 6th line

'This means that the last digit in a datetime instance (that is, yyyy-MM-dd hh:mm:ss.xxx) can be only 0,4,7.'

According to help at msdn available, it is mentioned that last digit in a datetime can only be 0,3,7. Also, Practically it is so. however, book mention it as 0,4,7.

Nida Kamran  Jan 04, 2012 
Printed Page 89
table 3-6

In page 89, I think that the table 3-6 should be:

0~2 = 6 bytes

3~4 = 7 bytes

5~7 = 8 bytes

Anonymous  Mar 05, 2010 
Printed Page 89
table 3-7

In page 89, I think that the table 3-7 should be:

0~2 = 8 bytes

3~4 = 9 bytes

5~7 = 10 bytes

Anonymous  Mar 05, 2010 
PDF Page 89
table 3-6 and table 3-7

datetime2 and datetimeoffset storage requirement
actually in both table precision 3 is missing

"6 bytes for precisions less than 3; 7 bytes for precisions 3 and 4. All other precisions require 8 bytes."

Iman Abidi  Aug 23, 2011 
Printed Page 115
step 4

On page 115, step 4, the primary key constraint has been omitted from the OrderID column definition.

Change:
CREATE TABLE Test.Orders ( OrderId INT IDENTITY(1000, 1) NOT NULL ,OrderDate DATE NOT NULL DEFAULT SYSDATETIME() ,CustomerId INT NOT NULL CONSTRAINT FKOrdersCustomerId REFERENCES Test.Customers (CustomerId));
To:
CREATE TABLE Test.Orders ( OrderId INT IDENTITY(1000, 1) NOT NULL CONSTRAINT PKOrders PRIMARY KEY ,OrderDate DATE NOT NULL DEFAULT SYSDATETIME() ,CustomerId INT NOT NULL CONSTRAINT FKOrdersCustomerId REFERENCES Test.Customers (CustomerId));

Anonymous  Sep 10, 2010 
Printed Page 115
Step 3

The answer provided does not show a CONSTRAINT to restrict the CustomerID to the range 1 to 100000. Rquires a line similar to CONSTRAINT CKCustIdInRange CHECK (CustomerId >= 1 AND CustomerId <= 100000)

David Irving  Apr 18, 2012 
123
Bottom CTE Code

When copied and executed the query returns the following error:

Msg 205, Level 16, State 1, Line 4
All queries combined using a UNION, INTERSECT or EXCEPT operator must have an equal number of expressions in their target lists.

Copied Text below:

DECLARE @EmployeeToGetOrgFor INT = 126;

WITH EMP_cte(BusinessEntityID, OrganizationNode, FirstName, LastName,
JobTitle, RecursionLevel )
AS (SELECT
e.BusinessEntityID,
e.OrganizationNode,
p.FirstName,
p.LastName,
e.JobTitle,
0
FROM HumanResources.Employee e
INNER JOIN Person. Person as p ON p.BusinessEntityID = e.BusinessEntityID
WHERE e.BusinessEntityID = @EmployeeToGetOrgFor
UNION ALL
Select
e.BusinessEntityID,
e.OrganizationNode,
p. FirstName,
p. LastName,
p. FirstName,
p. LastName,
e. JobTitle,
RecursionLevel + 1
FROM HumanResources.Employee e
INNER JOIN EMP_cte ON e.OrganizationNode = EMP_cte.OrganizationNode. GetAncestor(1)
INNER JOIN Person.Person p ON p.BusinessEntityID = e. BusinessEntityID)

SELECT
EMP_cte.RecursionLevel ,
EMP_cte.BusinessEntityID,
EMP_cte.FirstName,
EMP_cte.LastName,
EMP_cte.OrganizationNode.ToString() AS OrganizationNode,
p.FirstName AS 'ManagerFirstName' ,
p.LastName AS 'ManagerLastName'
FROM EMP_cte
INNER JOIN HumanResources.Employee e ON EMP_cte.OrganizationNode.GetAncestor(1) = e.OrganizationNode
INNER JOIN Person.Person p ON p.BusinessEntityID = e.BusinessEntityID
ORDER BY
RecursionLevel ,
EMP_cte.OrganizationNode.ToString()
OPTION (MAXRECURSION 25);

Anonymous  Apr 01, 2010 
Printed Page 152
Third paragraph from bottom, second sentence

"Any error with a severity level of 16 or higher is logged automatically to the SQL Server error log and the Windows Application Event Log."

http://msdn.microsoft.com/en-us/library/ms164086.aspx - indicates "Error messages with a severity level from 19 through 25 are written to the error log."

Confirm please: Are errors with severity 16-18 automatically written to error logs?

Rich Weissler  Jul 29, 2011 
Printed Page 160
code example at the bottom of the page

Page 160, 161: code example returns an error when executed

On page 160, the code example at the bottom of the page returns an error when executed.

Change:
DECLARE @ProductID INT,
@ProductName VARCHAR(50),
@ListPrice MONEY

DECLARE curproducts CURSOR FOR
SELECT ProductID, ProductName, ListPrice FROM Products.Product
FOR READ ONLY

OPEN curproducts

FETCH curproducts INTO @ProductID, @ProductName, @ListPrice

WHILE @@FETCH_STATUS = 0
BEGIN
SELECT @ProductID, @ProductName, @ListPrice
FETCH curproducts INTO @ProductID, @ProductName, @ListPrice
END

CLOSE curproducts
DEALLOCATE curproducts

To:
DECLARE @ProductID INT,
@Name VARCHAR(50),
@ListPrice MONEY

DECLARE curproducts CURSOR FOR
SELECT ProductID, Name, ListPrice FROM Production.Product
FOR READ ONLY

OPEN curproducts

FETCH curproducts INTO @ProductID, @Name, @ListPrice

WHILE @@FETCH_STATUS = 0
BEGIN
SELECT @ProductID, @Name, @ListPrice
FETCH curproducts INTO @ProductID, @Name, @ListPrice
END

CLOSE curproducts
DEALLOCATE curproducts

Anonymous  Sep 16, 2010 
Printed Page 162
.

Page 162:

"When a stored procedure is created, SQL Server checks the syntax but does not validate any of the objects referenced within the procedure."

I found this claim to be untrue. And I found it to be untrue while completing the Chapter Exercise on page 165.

In Exercise Step 2 on Page 165, we are advised to create a stored procedure which selects column named 'EmployeeId.' When executing this command, I received an error because no such column exists in the Employee table. Therefore, not only is page 165 incorrect in that it probably should read 'BusinessEntityID,' but page 163 is incorrect as well, because attempting to create this stored procedure checked the underlying Employee table.

Anonymous  Jun 07, 2011 
Printed Page 207
right below the Figure 6-4, just before the "Table-Valued UDFs" topic.

The paragraph mentions "table-valued UDF" while it should be "correlated sub-query".

Anonymous  Oct 05, 2011 
Printed Page 225, 226
the ALTER INDEX statemen

On page 225 and 226, the ALTER INDEX statement in the code snippet references the wrong table.

Change:
-- Rebuild the table's clustered index.
ALTER INDEX ALL ON Test.OtherTable REBUILD;

To:
-- Rebuild the table's clustered index.
ALTER INDEX ALL ON Test.IndexInsertTest REBUILD;

Anonymous  Sep 22, 2010 
Printed Page 238
the first sentence of the first paragraph

On page 238, the first sentence of the first paragraph is incorrect.

Change:
"You define a partition function by using the CREATE PARTITION SCHEME statement."

To:
"You define a partition scheme by using the CREATE PARTITION SCHEME statement."

Anonymous  Sep 23, 2010 
Printed, PDF Page 272
code example

On page 272, the code example does not return the specified result.

Change:

SELECT
c.CustomerID AS '@Id'
,c.AccountNumber AS '@AccountNumer'
,c.rowguid AS 'comment()'
,CAST('<Test />' AS XML) AS 'node()'
,c.CustomerType AS 'AdditionalInfo/@Type'
,c.ModifiedDate AS 'AdditionalInfo/text()'
,c.rowguid AS 'node()'
FROM Sales.Customer AS c
WHERE c.CustomerID IN (1,2)
FOR XML PATH('Customer'), ROOT('Customers');

To:

SELECT
c.CustomerID AS '@Id'
,c.AccountNumber AS '@AccountNumer'
,c.rowguid AS 'comment()'
,CAST('<Test />' AS XML) AS 'node()'
,c.CustomerType AS 'AdditionalInfo/@Type'
,c.ModifiedDate AS 'AdditionalInfo/text()'
FROM Sales.Customer AS c
WHERE c.CustomerID IN (1,2)
FOR XML PATH('Customer'), ROOT('Customers');

Anonymous  Sep 24, 2010 
Printed, PDF Page 272
code example

On page 272, the code example does not return the specified result when executed.
Change:
SELECT
c.CustomerID AS "@Id"
,c.AccountNumber AS "@AccountNumer"
,c.rowguid AS "comment()"
,CAST('<Test />' AS XML) AS "node()"
,c.CustomerType AS "AdditionalInfo/@Type"
,c.ModifiedDate AS "AdditionalInfo/text()"
,c.rowguid AS "node()"
FROM Sales.Customer AS c
WHERE c.CustomerID IN (1,2)
FOR XML PATH('Customer'), ROOT('Customers');
To:
SELECT
c.CustomerID AS "@Id"
,c.AccountNumber AS "@AccountNumer"
,c.rowguid AS "comment()"
,CAST('<Test />' AS XML) AS "node()"
,c.CustomerType AS "AdditionalInfo/@Type"
,c.ModifiedDate AS "AdditionalInfo/text()"
FROM Sales.Customer AS c
WHERE c.CustomerID IN (1,2)
FOR XML PATH('Customer'), ROOT('Customers');

Anonymous  Sep 24, 2010 
Printed, PDF Page 298
C# code example

On page 298, in the C# code example, the following line of code is unnecessary, and can be removed:

using System.Runtime.InteropServices;

Anonymous  Sep 25, 2010 
Printed, PDF Page 305
C# code example

On page 305, in the C# code example, the following line of code is unnecessary and can be removed:

using System.Runtime.InteropServices;

Anonymous  Sep 25, 2010