About the Transact-SQL Reference

The Microsoft SQL Server Transact-SQL Reference explains how to use Transact-SQL®, the enhanced version of SQL (structured query language), and provides in-depth reference information and examples.

This book uses many examples to illustrate database fundamentals. Most examples refer to the pubs sample database. The pubs sample database is included as a learning tool; it is created when SQL Server is installed. To use the sample database, your system must have access to the pubs database. If you have a localized version of SQL Server and want to try the examples, drop the localized version of pubs and install the U.S. English version of pubs. To install the U.S. English version of pubs, run the INSTPUBS.SQL script with the isql command-line utility. This script can be found in the INSTALL directory of SQL Server. Also, as you execute the examples in this book, you alter the pubs database, which can change the output you receive from some of the example queries. You can reinstall the original pubs database at any time by running the INSTPUBS.SQL script.

To run the INSTPUBS.SQL script, from an operating-system prompt, type:

isql /Usa /Ppassword /Sserver -i\sql60\install\instpubs.sql

Note You can create the queries in this book by using isql, ISQL/w, the query analyzer in SQL Enterprise Manager, or any number of other (third-party or custom-built) tools.

For details on isql, see the isql command-line utility. For details on ISQL/w, see the Utilities and Executables topic. For details on SQL Enterprise Manager, see the SQL Enterprise Manager online Help.