Errata

Transact-SQL Programming

Errata for Transact-SQL Programming

Submit your own errata for this product.

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 21
second example

should be
WHILE @month < 12

and not
WHILE @month <=12

Anonymous   
Printed Page 22
2nd example

The example code is....

-- declare the cursor
DECLARE titles_cursor CURSOR
FOR
SELECT title_id
FROM titles

-- declare the variables that will hold values retrieved by the cursor
DECLARE @title_id CHAR(6)

-- fetch the next set of values retrieved by the cursor
FETCH titles_cursor INTO @title_id

SELECT @title AS 'Name of book'

-- close and deallocate the cursor
CLOSE titles_cursor
DEALLOCATE CURSOR titles_cursor
*********************************
*********************
....... this code doesn't seem to work at all, nor does it seem to make
sense...maybe I am missing something. Otherwise, I like the book, and
the way it is written. I have installed the MS SQL Server eval system
from the CD, and use it to test the examples, and also test them out on
Sybase ASE 12.0 at work (though I don't have sa privaleges there, I can
o much of the examples).

Anonymous   
Printed Page 23
1st example - middle of page

IF EXISTS (SELECT * FROM authors WHERE au_fname = 'Elmer'
AND au_lname 'Fudd')
PRINT "Happy Hunting, it's duck season!"
ELSE RAISERROR('Warning! Duck hunting widout a wicense!',16,1)
********************
missing equal sign before FUDD

Anonymous   
Printed Page 387
1st paragraph under CONVERT heading

The example of "datatype" omits a trailing bracket.

The text reads:
"where

datatype[( length [,scale] )
Defines the type that you want to convert to."

I believe it should read:
"where

datatype[( length [,scale] )]
Defines the type that you want to convert to."

Anonymous   
Printed Page 459
Top of page, code example

Currently reads:

IF (SELECT OBJECT_ID(@TBLNAME)) = NULL
BEGIN
RAISERROR 25000 'INVALID TABLE SELECT'
RETURN 1
END

ETC...

SHOULD READ

IF (SELECT OBJECT_ID(@TBLNAME)) IS NULL

Anonymous   
Printed Page 459
Top of page, code example

Currently reads:

IF (SELECT OBJECT_ID(@TBLNAME)) = NULL
BEGIN
RAISERROR 25000 'INVALID TABLE SELECT'
RETURN 1
END

ETC...

SHOULD READ

IF (SELECT OBJECT_ID(@TBLNAME)) IS NULL
----

ETC...

This code does not work in SQL 7 with an = sign.

Anonymous   
Printed Page 662
second comparison table (pure ansi sql versus tsql with set rowcount)

The phrase "ORDER by ytd_sales" should be replaced with "ORDER by ytd_sales DESC" to
retrieve the top five best-selling titles.

Anonymous   
Printed Page 739
protecttype description

I suspect the <action> value in sysprocedures is not the "T" value in spt_values, but
is some other letter. I just can't figure out which.

Anonymous