SQL Server 6.0 has significantly enhanced the features listed in the following table. The enhancements are then described in detail.
Feature Area |
Related statements and Transact-SQL Reference topics |
---|---|
CASE expression | CASE Expression |
Comments | Comments |
Configuration | sp_configure system stored procedure |
Database consistency checker | DBCC statement |
Datatypes | Any statement that uses datatypes: CREATE TABLE, CREATE PROCEDURE, DECLARE, etc. |
Double quote (") delimited identifiers | Identifiers (includes quoted identifiers) and SET statement |
Dynamically-built string execution | EXECUTE statement |
Functions | Datatypes and Functions |
Keywords | Keywords (includes reserved words) |
Error handling | RAISERROR statement |
Server cursors | Cursors, DELETE and UPDATE statements |
Session settings | SET statement |
Stored procedures | Stored Procedures |
System tables | System Tables |
Utilities and command-line executables | Utilities and Executables |
Variables | Variables |
The ANSI-compliant CASE expression allows SQL expressions to be simplified for conditional values (such as to classify certain values in a results set). The CASE expression provides extremely powerful capabilities in SQL Server 6.0. The CASE expression is ANSI SQL-92-compliant and allowed anywhere an expression is used. For details, see the CASE Expression topic.
In SQL Server 6.0, ANSI-compliant comments can be defined using the double hyphen (--) identifier. ANSI-style comments should be used for all comments that are nested. The earlier comment style (/* text_of_comments */) is still available for multiline comments, but it should not be used for nested comments. For details, see the Comments topic.
SQL Server 6.0 includes many new standard and advanced configuration options. Some configuration options that used to be set up by using the SQL Setup utility are now available as advanced options.
For details of the new options, whether standard or advanced, see the sp_configure system stored procedure.
DBCC, the database consistency checker, includes many new options and enhancements to previously existing options. For details, see the DBCC statement.
Datatypes specify the data characteristics of columns, stored-procedure parameters, and local variables.
SQL Server 6.0 includes these datatype changes:
·For ANSI compatibility, configurable session- or database-level default column nullability is used to determine the nullability of a column or a user-defined datatype when the nullability is not explicitly defined. The ANSI NULL default (default allows null values) is configurable for the client session (with the SET statement) or for the entire database (with the sp_dboption system stored procedure). Additionally, a system function (GETANSINULL) has been added that allows the current nullability setting to be queried. For information about precedence and rules of nullability, see the CREATE TABLE statement. For information about session- or database-level default nullability, see the SET statement and the sp_dboption system stored procedure. For details on system functions, see the Functions topic.
Double quote delimited identifiers allow the server to skip evaluation of the text that appears within double quotation marks ("). The text within double quotation marks can include any kind of character in the installed code page except for double quotation marks. This feature provides ANSI compatibility for delimited identifiers. And although not recommended, keywords specified within double quotation marks can now be used as object names. For details, see the Identifiers topic and the SET statement.
The EXECUTE statement has been enhanced to support the execution of a character string constructed at execution time as a Transact-SQL batch. This allows for object names and Transact-SQL syntax to be resolved at execution time rather than compile time. For details, see the EXECUTE statement.
Built-in functions allow access to database or server information from within an expression such as a WHERE clause or the SELECT statement. Many of these functions have been updated for use with new features. The mathematical functions have been updated to allow numeric and decimal datatypes.
These system functions have been added:
For details, see the Functions topic.
Numerous keywords and reserved words have been added in SQL Server 6.0. Keywords include words that cannot be used for object or column names. Reserved words include words that, for future compatibility reasons, should be avoided for object or column names. For details and a complete list of keywords and reserved words, see the Keywords topic.
The RAISERROR statement has been enhanced to allow argument substitution to an error message (similar to the C printf capabilities). The severity of RAISERROR messages can now be configured. When creating a RAISERROR message, a user-defined message can now be created or a message can be referenced from the sysmessages system table. To create user-defined messages, three new system procedures have been added. For details, see the RAISERROR statement.
SQL Server 6.0 supports forward, backward, absolute, and relative-position server cursors. The advantages of server cursors, which follow and extend standard ANSI conventions, can be seen explicitly through Transact-SQL cursors and transparently through built-in server functions accessed by client programs using DB-Library™ or ODBC. In addition to the statements used for cursor declaration and manipulation (DECLARE, OPEN, FETCH, and so on), the DELETE and UPDATE statements have been modified for use within a cursor with the WHERE CURRENT OF clause.
For information about creating, removing, and using cursors by using Transact-SQL statements, see the Cursors topic. For information about manipulating cursor data (a single "fetched" row), see the DELETE and UPDATE statements.
The SET command now includes several options that control default datatype nullability, whether double quotation mark-delimited identifiers are evaluated by the server, how identity values are handled, and the transaction isolation level. For details, see the SET statement.
System stored procedures provide a consistent method for updating the system catalog (the tables in the master database used to maintain and track overall system configuration). Some stored procedures have been added, and many existing system procedures have been enhanced.
These are the categories of system-supplied stored procedures:
Additionally, some undocumented procedures may exist. These procedures are for internal use or have been replaced by new features. For example, some stored procedures used only to record primary key and foreign key relationships still exist but are no longer included in Microsoft SQL Server documentation because constraints should now be used to enforce referential integrity. Use these procedures only if you have used them with earlier releases or as examples for your own procedures. The undocumented procedures are for internal use and backward compatibility only; they will not be maintained and may not be included in future releases.
System tables store information about the database (database catalog¾tables found in all databases) or about the system (system catalog¾tables found only in the master database). Because new features such as replication and constraints require information to be maintained in one or all of these databases, certain tables (replication tables and SQL Executive tables) have been added. For details on replication, the distribution database, and managing alerts with the SQL Executive, see the Microsoft SQL Server Administrator's Companion. For details on these tables, see the System Tables ¾ Database Catalog topic.
The bldmastr command-line utility has been replaced by the SQL Setup graphical user interface. All options previously available only through bldmastr have been moved or have been enhanced in SQL Setup.
The isql command-line utility has been enhanced for integrated login security and includes enhanced error handling on exit.
For details, see the Utilities and Executables topic.
Global variables are maintained by the system and give specific information about the server or the current user's activity. Because of new features in SQL Server 6.0, many new global variables have been added. For details, see the Variables topic.