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.
Version |
Location |
Description |
Submitted By |
Date submitted |
Date corrected |
Printed |
Page xxii
The "Comments and Questions" section was replaced with the following |
text:
Comments and Questions
The information in this book has been tested and verified, but you may find
that features have changed (or you may even find mistakes!). You can send any
errors you find, as well as suggestions for future editions, to:
O'Reilly & Associates, Inc.
101 Morris Street
Sebastopol, CA 95472
(800) 998-9938 (in the United States or Canada)
(707) 829-0515 (international/local)
(707) 829-0104 (fax)
There is a web page for this book, where we list any errata, examples, and
additional information. You can access this page at:
http://www.oreilly.com/catalog/9781565924017/
To ask technical questions or comment on the book, send email to:
bookquestions@oreilly.com
For more information about our books, conferences, software, Resource Centers,
and the O'Reilly Network, see our web site at:
http://www.oreilly.com
|
Anonymous |
|
Dec 01, 2000 |
Printed |
Page xxiii
This note was added as the last paragraph under "Acknowledgments" |
"A special thanks goes to Perry Stearn, whose amazing eye for
detail and methodical approach have greatly improved our text."
|
Anonymous |
|
Dec 01, 2000 |
Printed |
Page 1
1 |
SFI links for the SQL Programmer product on the CD do not work, nor do the ammended
links for the updated product. Does not appear to be on the SFI web site
AUTHOR: We need to post information on the web site stating that SFI is no longer
selling this product. BMC bought SFI and then let the product drop off radar.
|
Anonymous |
|
|
Printed |
Page 9
|
The third sentence of the second paragraph did read:
"For example, the trick name appears in every animal record,
but the trick_nbr should be sufficient since we've already got
the name in the Tricks table."
Now reads:
"For example, both the trick_nbr and trick_name appear in every
record of the old, 1NF Trick table. However, we don't need the
trick_name in the 2NF Animal Tricks table since we've already got
the trick_name in the 2NF Tricks table."
|
Anonymous |
|
Dec 01, 2000 |
Printed |
Page 12
|
The fourth paragraph in the sidebar did read:
"Almost a purely academic exercise, SNF..."
Now reads:
"Almost a purely academic exercise, 5NF..."
|
Anonymous |
|
Dec 01, 2000 |
Printed |
Page 13
In first paragraph of the section "Row Processing Versus Set Processing," |
change "declarative processing" to "procedural processing." In the second
paragraph, change "procedural processing" to "declarative processing."
|
Anonymous |
|
Dec 01, 2000 |
Printed |
Page 49
In Figure 2-6, changed "job_is=job_id" to "job_id=job_id" and changed |
"au_lnname" and "au_fnname" in the "authors" table to "au_lname" and
"au_fname".
|
Anonymous |
|
Dec 01, 2000 |
Printed |
Page 58
|
The second paragraph of comments for DEFAULT did read:
"Defaults may be table- or column-level."
Now reads:
"A column default may be declared with the column definition or
with the table definition at the end of the CREATE TABLE statement."
|
Anonymous |
|
Dec 01, 2000 |
Printed |
Page 63
example middle of page |
SQL Server 2000 and later versions will not allow double quotes in the line DEFAULT ("CA")...
it should use single quotes, like DEFAULT ('CA')
|
Anonymous |
|
|
Printed |
Page 77
The following warning should be added below the grid at the top of the |
page:
"Cross join syntax is a Microsoft extension and is not supported on
Sybase ASE 11.5."
|
Anonymous |
|
|
Printed |
Page 77
The Sybase side of the grid on the top of the page was changed to read as |
follows:
SELECT [ALL | DISTINCT] select_item1,
select_item2, select_item3, ...
[INTO [table_name]]
[FROM tablename [alias]
[(index {index_name | table_name }
[parallel [degree_of_parallelism]]
[prefetch size ][lru|mru])
[holdlock | noholdlock] [shared]] [,...,
[,...,tablename16 [alias16]
[(index {index_name | table_name }
[parallel [degree_of_parallelism]]
[prefetch size ][lru|mru])
[holdlock | noholdlock] [shared]]
[WHERE clause ]
[GROUP BY clause ]
[HAVING clause ]
[ORDER by clause ]
[COMPUTE clause ]
[FOR { READ ONLY | UPDATE [ OF list_of_
columns]}]
[AT ISOLATION {READ UNCOMMITTED | READ
COMMITTED |SERIALIZABLE}]
[FOR BROWSE]
|
Anonymous |
|
Dec 01, 2000 |
Printed |
Page 80
At the very bottom of the page, the last line of the code snippet did |
read:
Select e.emp_id,
(SELECT MAX(hire_date) FROM employee) = "Max_Hire_Date"
FROM employee
Now reads:
SELECT e.emp_id,
(SELECT MAX(hire_date) FROM employee) = "Max_Hire_Date"
FROM employee AS e
|
Anonymous |
|
Dec 01, 2000 |
Printed |
Page 84
In Figure 3-1, changed "emp_id=job_id" to "job_id=job_id". |
|
Anonymous |
|
Dec 01, 2000 |
Printed |
Page 85
In the second paragraph, changed |
"(Outer joins will be explained soon.)"
to:
"(Outer joins are explained in Table 3-2.)"
|
Anonymous |
|
Dec 01, 2000 |
Printed |
Page 86
In Table 3-2 (first column), changed "LEFT JOINS" to "LEFT JOIN". |
|
Anonymous |
|
Dec 01, 2000 |
Printed |
Page 104-105
The informal table describing Sale and New_Sales was incorrect. |
The column describing the contents of the New_Sales table should contain
'payment_terms CHAR(12) NOT NULL' immediately under the 'order_date' entry.
Adding this value in makes the following text correct.
|
Anonymous |
|
Dec 01, 2000 |
Printed |
Page 118
|
In the second code snippet on the page, the eighth line down did read:
UPDATETEXT pub_info.pr_info @pointervalue 'Now is the time for all good
Now reads:
WRITETEXT pub_info.pr_info @pointervalue 'Now is the time for all good
|
Anonymous |
|
Dec 01, 2000 |
Printed |
Page 126
|
The second paragraph did read:
"For example, the following identifier references the byroyalty
stored procedure in the master database owned by the developer
auser."
Now reads:
"For example, the following identifier references the byroyalty
stored procedure in the pubs database owned by the developer dbo
(database owner):" (note the colon)
|
Anonymous |
|
Dec 01, 2000 |
Printed |
Page 130
At the end of the paragraph under "Delimiters and Operators," changed |
|
Anonymous |
|
Dec 01, 2000 |
Printed |
Page 130
In Table 4-2, changed the usage description for % from |
"Wildcard attribute indicator"
to:
"Mod operator; also a wildcard attribute indicator"
|
Anonymous |
|
Dec 01, 2000 |
Printed |
Page 131-132
In Table 4-3, the "Exclusive OR" and "OR" operators symbols were |
backward. It should be "| = OR" and "^ = Exclusive OR."
|
Anonymous |
|
Dec 01, 2000 |
Printed |
Page 167
Top of page |
The following WHERE clause from the book:
"...WHERE LogID = (SELECT MAX(LogID) FROM StockLog) AND Type!='N'..."
Will return NO RECORDS AT ALL if the most recent Log record is of Type 'N'. It is
true that we don't want to deal with Type 'N' records, but the goal is to find the
most recent change that was not of type 'N'.
The following minor change to the WHERE clause will remedy that:
"...WHERE LogID = (SELECT MAX(LogID) FROM StockLog WHERE Type!='N')..."
|
Anonymous |
|
|
Printed |
Page 168
In the 3rd-to-last line on the page, changed "COMMIT, COMMIT" to "COMMIT." |
|
Anonymous |
|
Dec 01, 2000 |
Printed |
Page 177
|
The third sentence in the third paragraph did read:
"There are 10 basic categories of system datatypes..."
Now reads:
"There are 9 basic categories of system datatypes..."
|
Anonymous |
|
Dec 01, 2000 |
Printed |
Page 184
|
The 5th line of the first bulleted item did read:
"WHERE hire_date LIKE May 5, 1994%"
Now reads:
"WHERE hire_date LIKE 'May 5 1994%'"
|
Anonymous |
|
Dec 01, 2000 |
Printed |
Page 185
|
The last paragraph, after "Approximate Numeric Datatypes," did read:
"Approximate numeric datatypes (FLOAT and REALl)..."
Now reads:
"Approximate numeric datatypes (FLOAT and REAL)..."
|
Anonymous |
|
Dec 01, 2000 |
Printed |
Page 186
|
The first two paragraphs on the page did read:
The FLOAT datatype, specified as FLOAT(length), can hold positive and
negative floating-point numbers with a maximum 15-digit precision.
Although you can specify a float length of 1 to 15, the default is 15.
This enables a range of values from positive 2.23E-308 through
1.79E-308, zero, and (negative) -2.23E-308 through -1.79E-308. Floats
are frequently used in scientific notation. Float values always
consume 8 bytes of storage space.
The REAL datatype, specified as REAL(length), is essentially a float
with a more limited range of values. REAL is limited to a 7-digit
maximum precision. Its allowable range of values encompasses 1.1E-38
through 3.40E-38, zero, and (negative) -1.18E-38 through -3.40E-38.
Its storage requirements are 4 bytes per REAL value. It is otherwise
identical to FLOAT.
They now read:
The FLOAT datatype can hold positive and negative floating-point
numbers with a maximum 15-digit precision. Although you can specify a
float length of 1 to 15, the default is 15. This enables a range of
values from (negative) -1.79E+308 through -2.23E-308, zero, and
(positive) 2.23E-308 through 1.79E+308. Floats are frequently used in
scientific notation. Float values always consume 8 bytes of storage
space.
The REAL datatype is essentially a float with a more limited range of
values. Note you cannot specify a precision when declaring a REAL as
you can with FLOAT. REAL is limited to a 7-digit maximum precision,
and is functionally equivalent to specifying a FLOAT(24). Its allowable
range of values is between (negative) -3.40E+38 through (positive)
3.40E+38.
|
Anonymous |
|
Dec 01, 2000 |
Printed |
Page 186
The fourth sentence in the third paragragh |
"The INT datatype can accomodate values ranging from -2,147,483,647 to 2,147,483,647; consuming..."
NOW READS:
The INT datatype can accomodate values ranging from -2,147,483,648 to 2,147,483,647; consuming..."
|
Anonymous |
|
Jan 01, 2004 |
Printed |
Page 211
|
The first bulleted item under "If Constructs" did read:
"If monthly sales exceed 200..."
Now reads:
"If monthly sales equal or exceed 200..."
|
Anonymous |
|
Dec 01, 2000 |
Printed |
Page 212
Deleted the comment at the beginning of the code sample at the end of |
the page ("-- check to see if the current user is the SA").
|
Anonymous |
|
Dec 01, 2000 |
Printed |
Page 214
The first paragraph after the note tip that begins |
"Another approach to the multitest IF..."
Has been replaced with the following text:
"Another approach to the multitest IF statement is available
through the OR keyword. The OR keyword enables you to couple
several conditional statements together. If any one of the
conditional statements meet the condition of the IF statement,
then the entire condition is considered TRUE. Only when all
the conditions fail to meet the condition of the IF statement
will the IF statement evaluate to FALSE. An IF...OR statement
might look like this:"
|
Anonymous |
|
Dec 01, 2000 |
Printed |
Page 215
|
The code after the first full paragraph did read:
"IF EXISTS (SELECT * FROM titles WHERE title_id IN ('FD1711','FD1032'))
BEGIN
UPDATE titles SET ytd_sales = 1700
WHERE title_id = 'FD1711'
UPDATE titles SET ytd_sales = 3000
WHERE title_id = 'FD1032'
END"
Now reads:
"IF EXISTS (SELECT * FROM titles WHERE title_id = 'FD1711')
UPDATE titles SET ytd_sales = 1700
WHERE title_id = 'FD1711'
IF EXISTS (SELECT * FROM titles WHERE title_id = 'FD1032')
UPDATE titles SET ytd_sales = 3000
WHERE title_id = 'FD1032'"
|
Anonymous |
|
Dec 01, 2000 |
Printed |
Page 215
|
The first sentence of the second full paragraph did read:
"This example tests for the existence of two values in the titles
table."
Now reads:
"This example tests for the existence of a value in the titles
table."
|
Anonymous |
|
Dec 01, 2000 |
Printed |
Page 215
|
The third sentence of the second full paragraph did read:
"If they do exist, our fine author Fudd has his ytd_sales numbers
updated."
Now reads:
"If either of the values exist, our fine author Fudd has his
ytd_sales numbers updated."
|
Anonymous |
|
Dec 01, 2000 |
Printed |
Page 215-216
|
The code sample that begins at the bottom of p. 215 did read:
IF EXISTS (SELECT * FROM titles WHERE title_id IN ('FD1711','FD1032'))
BEGIN
UPDATE titles SET ytd_sales = 1700
WHERE title_id = 'FD1711'
UPDATE titles SET ytd_sales = 3000
WHERE title_id = 'FD1032'
END
ELSE
BEGIN
INSERT INTO titles
VALUES ('FD1711', 'Zen and the Art of Wabbit Hunting', 'psychology',...)
INSERT INTO titles
VALUSE ('FDU1032', 'The ACME Shopping Experience', 'business',...)
END
Now reads:
"IF EXISTS (SELECT * FROM titles WHERE title_id = 'FD1711')
UPDATE titles SET ytd_sales = 1700
WHERE title_id = 'FD1711'
ELSE
INSERT INTO titles
VALUES ('FD1711', 'Zen and the Art of Wabbit Hunting', 'psychology',...)
IF EXISTS (SELECT * FROM titles WHERE title_id = 'FD1032')
UPDATE titles SET ytd_sales = 3000
WHERE title_id = 'FD1032'
ELSE
INSERT INTO titles
VALUES ('FD1032', 'The ACME Shopping Experience', 'business',...)"
|
Anonymous |
|
Dec 01, 2000 |
Printed |
Page 216
|
The text above the header "Nested IF...ELSE Statements" did read:
"IF EXISTS (SELECT * FROM titles WHERE title_id IN ('FD1711',
'FD1032'))BEGIN SELECT...
In fact, some Transact-SQL gurus prefer to smash the BEGIN clause
onto the same line as the IF. (You would have to place the SELECT
on a new line, however.)"
Now reads:
"IF EXISTS (SELECT * FROM titles WHERE title_id IN ('FD1711',
'FD1032')) BEGIN UPDATE...
In fact, some Transact-SQL gurus prefer to smash the BEGIN clause
onto the same line as the IF. (You would have to place the UPDATE
on a new line, however.)"
|
Anonymous |
|
Dec 01, 2000 |
Printed |
Page 219
|
The block of code did read:
IF @inventory_level <= 100 GOTO step2
IF @inventory_level BETWEEN 99 and 21
BEGIN
EXECUTE order_books @title_id
step2
END
IF @inventory_level >= 20 GOTO dangerously_low_inv
step2:
...<some more code here>...
dangerously_low_inv:
EXECUTE order_books @title_id
RAISERROR('This item may have been backordered!',16,1)
step2
Now reads:
IF @inventory_level >= 100 GOTO step2
IF @inventory_level BETWEEN 21 and 99
BEGIN
EXECUTE order_books @title_id
GOTO step2
END
IF @inventory_level <= 20 GOTO dangerously_low_inv
step2:
...<some more code here>...
dangerously_low_inv:
EXECUTE order_books @title_id
RAISERROR('This item may have been backordered!',16,1)
GOTO step2
|
Anonymous |
|
Dec 01, 2000 |
Printed |
Page 228
The following changes were made in the code sample at the top of the |
page:
a) Inserted the following line above "BEGIN TRANSACTION" at the same level of
indent: "DECLARE @err_status INT".
b) In line 7, changed "VALUSE" to "VALUES" and "FDU1032" to "FD1032".
c) In line 11, changed "@@err_status" to "@err_status".
d) Deleted the final "END".
|
Anonymous |
|
Dec 01, 2000 |
Printed |
Page 235
The third paragraph has been deleted and replaced with the following |
text:
"This command returns no result, but it impacts global variables. In
Sybase the @@rowcount global variable is incremented every time there
is a fetch within a cursor. This means that only once all the rows have
been fetched can you determine how many rows were actually in the
result set to begin with. Microsoft provides a separate global variable
@@cursor_rows to report the number of rows in the last opened cursor:"
|
Anonymous |
|
Dec 01, 2000 |
Printed |
Page 238
|
The top line in Table 8-4 did read:
"Microsoft @@fetch_status Sybase @@sqlstats"
Now reads:
"Microsoft @@fetch_status Sybase @@sqlstatus"
|
Anonymous |
|
Dec 01, 2000 |
Printed |
Page 242
Table 8-5, column 1 |
Changed "cursor_name" to "DEALLOCATE cursor_name".
|
Anonymous |
|
Dec 01, 2000 |
Printed |
Page 276
In line 5 of the last paragraph, changed "AllMS" to "All." |
|
Anonymous |
|
Dec 01, 2000 |
Printed |
Page 279
In the last line on the page, changed "nam with a" to "name with a." |
|
Anonymous |
|
Dec 01, 2000 |
Printed |
Page 318
Deleted the second-to-last sentence under "Row" ("Both Microsoft SQL |
Server Version 7.0 and Sybase Adaptive Server 11.9 have added full row level
blocking.").
|
Anonymous |
|
Dec 01, 2000 |
Printed |
Page 326
In the second bullet, changed "SETDEADLOCKPRIORITY" to "SET |
DEADLOCKPRIORITY" (added a space).
|
Anonymous |
|
Dec 01, 2000 |
Printed |
Page 372
Table 12-8 |
DATALENGTH( 'ABC ' ) 5
NOW READS:
DATALENGTH( 'ABC ' ) 4
|
Anonymous |
|
Jan 01, 2004 |
Printed |
Page 439
1st sample query |
FROM sysoobjects
should read:
FROM sysobjects
|
Anonymous |
|
|
Printed |
Page 442
3rd (code example2) |
CREATE PROCEDURE get_yearly_sales_summary
@year INT=NULL
AS
IF (@year <> NULL)
NOW READS:
CREATE PROCEDURE get_yearly_sales_summary
@year INT=NULL
AS
IF (@year IS NOT NULL)
|
Anonymous |
|
Jan 01, 2004 |
Printed |
Page 471
|
Line 27 did read:
"SET big_return = *"
Now reads:
"SET big = '*'"
|
Anonymous |
|
Dec 01, 2000 |
Printed |
Page 471
|
Line 28 did read:
"WHERE total_return > 1000"
Now reads:
"WHERE total_revenue > 1000"
|
Anonymous |
|
Dec 01, 2000 |
Printed |
Page 472
|
Line 16 did read:
"FROM#detail"
Now reads:
"FROM #detail"
|
Anonymous |
|
Dec 01, 2000 |
Printed |
Page 490
In both columns of the table, the line |
"FOR INSERT, UPDATE"
Has been changed to:
"FOR INSERT, UPDATE, DELETE"
|
Anonymous |
|
Dec 01, 2000 |
Printed |
Page 491
|
The second line on the page did read:
"every time a record gets created or modified:"
Now reads:
"every time a record is added, modified, or deleted:"
|
Anonymous |
|
Dec 01, 2000 |
Printed |
Page 491
|
The third line of the code sample did read:
"FOR INSERT,UPDATE"
Now reads:
"FOR INSERT, UPDATE, DELETE"
|
Anonymous |
|
Dec 01, 2000 |
Printed |
Page 491
|
The last line on the page did read:
"FOR insert,update"
Now reads:
"FOR insert, update, delete"
|
Anonymous |
|
Dec 01, 2000 |
Printed |
Page 492
|
Line 16 did read:
RAISERROR 50001"Cannot create entry for non-existent title"
Now reads:
RAISERROR 50001 "Cannot create entry for non-existent title"
|
Anonymous |
|
Dec 01, 2000 |
Printed |
Page 492
|
Line 24 did read:
WHERE a.author_id = b.author_id) <> @rcount
Now reads:
"WHERE a.au_id = b.au_id) <> @rcount"
|
Anonymous |
|
Dec 01, 2000 |
Printed |
Page 495
"ROLLBACK TRIGGER" |
Now reads:
"ROLLBACK TRIGGER (Sybase only)"
|
Anonymous |
|
Dec 01, 2000 |
Printed |
Page 528
|
The 5th line on the page did read:
"... found in ever database ..."
Now reads:
"... found in every database ..."
|
Anonymous |
|
Dec 01, 2000 |
Printed |
Page 528
|
The 7th line did read:
"... find iti n the database ..."
Now reads:
"... find it in the database ..."
|
Anonymous |
|
Dec 01, 2000 |
Printed |
Page 578
|
Before the "Temporary Data Storage" heading, insert a warning that reads:
"Sybase and Microsoft differ in the way they record user-defined
messages. Microsoft stores them in the sysmessages table, along with
the system messages, while Sybase stores them in the sysusermessages
table. Regardless of whether you are using Sybase or Microsoft SQL
Server, you will still use the sp_addmessage to add the user-defined
message. The server then takes care of returning the appropriate
message when a RAISERROR is raised. The most critical aspect of the
sys(user)messages structure is that you can add your own messages to a
database."
|
Anonymous |
|
|
Printed |
Page 595
|
Item #5 did read:
"If you prefer to resort to reverse-engineering the code, the good
news is that the CD-ROM accompanying this book has a number of
Transact-SQL utilities designed to do just that. Table 19-2 briefly
describes each utility and its purpose."
Now reads:
"If you prefer to resort to reverse-engineering the code, the good
news is that a number of Transact-SQL utilities designed to do just
that have been included on the CD-ROM accompanying this book in the
files gserver.sql and sqlv600.sql. Table 19-2 briefly describes each
utility and its purpose."
|
Anonymous |
|
Dec 01, 2000 |
Printed |
Page 595
Table 19-2 has been modified to read as follows |
Filename | Procedure | Purpose
____________|_______________|_____________________________________
SQLV600.SQL | sp_rtable | Reverse-engineer a table
SQLV600.SQL | sp_ralltables | Reverse-engineer all tables...
SQLV600.SQL | sp_rindex | Reverse-engineer indexes...
SQLV600.SQL | sp_rallindex | Reverse-engineer all indexes...
gserver.SQL | sp_gserver | Reverse-engineer the contents...
SQLV600.SQL | sp_rbinddefs | Reverse-engineer binding...
SQLV600.SQL | sp_rbindrules | Reverse-engineer binding...
|
Anonymous |
|
Dec 01, 2000 |
Printed |
Page 626
|
The first sentence of the third paragraph did read:
"Once you have isssued SET NOEXEC OFF, the only command that may be
executed is SET NOEXEC ON."
Now reads:
"Once you have isssued SET NOEXEC ON, the only command that may be
executed is SET NOEXEC OFF."
|
Anonymous |
|
Dec 01, 2000 |
Printed |
Page 687
In Table 21-2, there were two entries for PAGE. The line "PAGE - |
Performance tuning and monitoring" has been removed from the table.
|
Anonymous |
|
Dec 01, 2000 |
Printed |
Page 690-700
|
The column header in Table 21-3 did read:
| Permis-| Vendor |
"DBCC Option | sions | Support | Description"
Now reads:
| Permis-| Vendor |
"DBCC Command | sions | Support | Description"
|
Anonymous |
|
Dec 01, 2000 |
Printed |
Page 690
|
The entry for CHECKIDENT in Table 21-3 did read:
"CHECKIDENT | | MS | Verifies that the internal
identify value for
Now reads:
"CHECKIDENT | SA or DBO | MS | Verifies that the internal
identify value for
|
Anonymous |
|
Dec 01, 2000 |
Printed |
Page 690
Table 21-3 did not used to contain an entry for DBCC CHECKSTORAGE. |
The following entry was added below CHECKIDENT:
| Permis-| Vendor |
DBCC Command | sions | Support | Description
CHECKSTORAGE | SA | Sybase | CHECKSTORAGE is a powerful set of DBCC
checks available only on Sybase servers.
It requires significant database administrator
setup and configuration to use properly,
including the creation of the dbccdb system
database. We are excluding this command
because it is outside the toolset of the
average Transact-SQL developer.
|
Anonymous |
|
Dec 01, 2000 |
Printed |
Page 691
|
In Table 21-3, column 1 did read:
"DREINDEX([..."
Now reads:
"DBREINDEX([..."
|
Anonymous |
|
Dec 01, 2000 |
Printed |
Page 695
|
The entry for PAGE in Table 21-3 did read:
"PAGE | | MS | Prints out the contents of a specific page"
Now reads:
"PAGE | SA | MS | Prints out the contents of a specific page"
|
Anonymous |
|
Dec 01, 2000 |
Printed |
Page 770
At the end of Table B-4, after VARP, the list of new functions in SQL |
Server Version 7 omits the new function YEAR. It should be placed after the
description of VARP and before the + and -.
The row in the table explaining the YEAR function should appear as follows:
Function Type Syntax Description
-----------------------------------------------
YEAR | Date | YEAR(date) | This is functionally equivalent to the
DATEPART(year, date) function. It returns
a 4-digit year.
{CD} The calc_db_size.sql script on the CD has an error. The new
calc_db_size.sql script is listed below as a replacement for the earlier,
buggy script:
CREATE PROC calculate_db_space @dbname VARCHAR(30) AS
-- declare necessary variables
DECLARE @ld_dbsize DEC(15,2), @ld_dbunused DEC(15,2)
DECLARE @msg_line VARCHAR(50)
-- don't run this calculation on TEMPDB
IF (@dbname <> 'tempdb')
BEGIN
-- the SET NOCOUNT ON command reduces unneeded feedback from SQL Server
SET NOCOUNT ON
-- calculate the space used
SELECT @ld_dbsize = SUM(CONVERT(DEC(15,2),size))
FROM master.dbo.sysusages
WHERE dbid = DB_ID(@dbname)
-- calculate the unused space
SELECT @ld_dbunused = @ld_dbsize - (SELECT SUM(CONVERT(DEC(15,2),reserved))
FROM sysindexes
WHERE indid IN (0, 1, 255))
-- print the output
SELECT "Megabytes Assigned" = (@ld_dbsize/512),
"Megabytes Unused" = (@ld_dbunused/512)
END
ELSE
BEGIN
-- build the error msg telling which procedure spawned the error.
SELECT @msg_line = 'TEMPDB is very transient. Don''t bother sizing it.'
RAISERROR(@msg_line,16,2) WITH LOG
-- quit the program
RETURN
END
|
Anonymous |
|
|
Printed |
Page 793
The following entry was added to the index: "DISTINCT, 78" |
|
Anonymous |
|
Dec 01, 2000 |
Printed |
Page 795
The following entry was added to the index: "HAVING, 94" |
|
Anonymous |
|
Dec 01, 2000 |
Printed |
Page 803
The entry "sysdevice, 725" was changed to "sysdevices, 725." |
|
Anonymous |
|
Dec 01, 2000 |
Printed |
Page 804
The entry "sysdevice, 725" under "system tables" was changed to |
|
Anonymous |
|
Dec 01, 2000 |
Printed |
Page 805
|
(805) Added a closing parenthesis to the entry "zombie process scenario."
|
Anonymous |
|
Dec 01, 2000 |