Special Edition Using Microsoft SQL Server 6.5 - Introduction

All of data processing is involved with the operations of storing and retrieving data. A database, such as Microsoft SQL Server, is designed as the central repository for all the data of an organization. The crucial nature of data to any organization underlies the importance of the method used to store it and enable its subsequent retrieval for processing.

Microsoft SQL Server uses the features of other databases and some features that aren't required for other databases to store data. Most of these additional features are made possible by SQL Server's tight integration with the Windows NT operating system. SQL Server contains the data storage options and the capability to store and process the same volume of data as a mainframe or minicomputer.

Like most mainframe or minicomputer databases, SQL Server is a database that has seen an evolution from its introduction in the mid-1960s until today. Microsoft's SQL Server is founded in the mature and powerful relational model, currently the preferred model for data storage and retrieval.

Unlike mainframe and minicomputer databases, a server database is accessed by users—called clients—from other computer systems rather than from input/output devices, such as terminals. Mechanisms must be in place for SQL Server to solve problems that arise from the access of data from perhaps hundreds of computer systems, each of which can process portions of the database independently from the data on the server.

Within the framework of a client/server database, a server database also requires integration with communication components of the server in order to enable connections with client systems. Microsoft SQL Server's client/server connectivity uses the built-in network components of Windows NT.

Unlike a stand-alone PC database or a traditional mainframe or minicomputer database, a server database, such as Microsoft SQL Server, adds service-specific middleware components—such as Open Database Connectivity (ODBC)—on top of the network components. ODBC enables the interconnection of different client applications without requiring changes to the server database or other existing client applications.

SQL Server also contains many of the front-end tools of PC databases that traditionally haven't been available as part of either mainframe or minicomputer databases. In addition to using a dialect of Structured Query Language (SQL), GUI applications can be used for both the storage, retrieval, and administration of the database.

Who Should Use This Book

This book is written for all users of Microsoft SQL Server— from database users to database administrators. It can be used by new users to learn about any feature of Microsoft SQL Server. It can also serve as a reference for experienced users who need to learn the use of a feature of the product that they haven't yet employed.

The CD-ROM that accompanies this book provides example Transact-SQL statements and demonstration applications provided by many third-party vendors to give you a feeling for many of the products and services available in the market, as well as to give you ideas for using SQL Server in your organization.

In addition, you can use the electronic version of this book that is included on the CD, enabling you to reference the information in the book on your monitor alongside an actual SQL Server database.

How to Use This Book

This book is divided into six sections. The sections are intended to present the use of SQL Server as a logical series of steps in the order in which the reader would most likely use the product. Ideally, you will go through the sections and their chapters in sequence.

Part I: Understanding SQL Server Fundamentals and Background Information

In Part I, the basic features of Microsoft SQL Server are discussed, and an overview of it's capabilities is presented. In this section, you'll learn about necessary information that is related to Microsoft SQL Server. The background information about SQL Server is recommended for all new readers and current users of SQL Server who may be unfamiliar with it.

In Chapter 1, "Introducing Microsoft SQL Server" you'll learn the origin and evolution of SQL Server and its implementation as a relational database. You'll also learn about the components of SQL Server, including the installation and configuration of the database and its client components. In Chapter 2, "Data Modeling and Database Design" you'll learn how to design a database. Moreover, you'll become familiar with the terminology that's associated with a relational database, such as SQL server.

Chapter 3, "Understanding the Underlying Operating System, Windows NT," explains the features of the operating system that SQL Server takes advantage of to obtain optimal performance. The SQL Server database components are designed solely for implementation on the Windows NT system.

Part II: Defining and Manipulating Data and Data Storage Units

In Part II, you learn how to create the storage areas and other storage structures of the database. You'll also learn to manipulate the stored data, including combining data from multiple sources. If you are already familiar with SQL or the previous version of SQL Server, you'll still want to read the chapters in this section to learn how this version differs from the earlier version. You'll also want to learn about the additions that support the ANSI SQL standard.

Chapter 4, "Creating Devices, Databases, and Transaction Logs" explains how you create the storage areas on a disk where you create your database and backups of your database. Chapter 5, "Creating Database Tables and Using Datatypes" provides you with instructions on how to create database tables and choose the datatypes of the table columns. You can also read about the considerations involved in your choice of table and table column characteristics.

Chapter 6, "Retrieving Data with Transact-SQL" provides instruction in the use of the SELECT statement and the addition of clauses to the SELECT statement for controlling the retrieval of targeted data. Chapter 7, "Performing Operations on Tables" continues the instruction on retrieving data begun in Chapter 6. Included in the discussion is instruction on how to combine data from multiple tables. Chapter 8, "Using Functions" provides a comprehensive treatment of the functions that you can use in Transact-SQL. The examples presented in the chapter are simple and direct, which facilitate the understanding of the use of the functions.

Part III: Defining Retrieval Structures

In Part III, you learn how to define database objects that are used to control the retrieval of data. The retrieval objects are stored in a database and provide both convenient and rapid ways of retrieving data.

In Chapter 9, "Managing and Using Views" you learn the definition and use of stored SELECT statements that are subsequently used like an actual table. You'll also learn of the problem of disappearing rows, a phenomena that occurs with the storage of rows through a view.

In Chapter 10, "Managing and Using Indexes and Keys" you learn how to define the database objects that are used to insure fast retrieval of the rows of database tables. In addition, you'll learn to use the database object that is a basis for insuring referential integrity in a database.

Part IV: Defining and Using Advanced Data Definition and Retrieval Structures

The chapters of Part IV continue the discussion of database objects and structures that enable data to be retrieved faster and more precisely. Chapter 11, "Managing and Using Rules and Defaults" contains information on how to restrict the values that may be inserted into database tables and other database structures.

Chapter 12, "Understanding Transactions and Locking" provides an understanding of the synchronization mechanism used by SQL Server to ensure the integrity of database tables and operations.

Chapter 13, "Managing Stored Procedures and Using Flow-Control Statements" and Chapter 14, "Creating and Managing Triggers" discuss the capability of creating a set of Transact-SQL statements that can be stored and subsequently executed as a group. You can use flow-control statements, including conditional statements, to effectively write a SQL program that manipulates your database. In addition, you'll learn to create a set of SQL statements that are automatically activated when SELECT, INSERT, UPDATE, or DELETE statements are executed on a database.

Chapter 15, "Creating and Using Cursors" provides you with instruction on the use of a feature of SQL Server that enables you to perform selection operations on individual rows of a database table. You can also randomly access an individual row and manipulate it without affecting other rows.

Part V: Performing Administrative Operations

Chapter 16, "Understanding Server, Database, and Query Options" provides you with the information necessary to configure your server and database for various uses and situations. In addition, you'll also learn to configure your queries against the database.

Chapter 17, "Optimizing Performance" explains how you can enhance a database and the retrieval of information from the database using important calculations based on different storage factors. Moreover, you'll learn to use the built-in monitoring tool of the Windows NT system to monitor the performance of SQL Server components and applications.

Chapter 18, "SQL Server Administration" provides you with information about how to keep data consistently available to the users of client systems. Availability of data from a database is ensured by a combination of fault-tolerant mechanisms and the duplication of data before it's lost.

Chapter 19, "SQL Server Security" continues the discussion of maintaining data availability by explaining the implementation of proper security for SQL Server and its databases. Chapter 20, "Setting Up and Managing Replication," discusses how you implement the automatic creation and maintenance of multiple copies of a database to enhance performance in the access of data.

The remaining chapters depart from the others in this section in that they discuss products that are used with SQL Server for communication and querying. Chapter 21, "Communicating with SQL Server" provides you with information about the client and server components used for the interconnection of systems. The network components and protocols are the basis on which SQL Server and client applications depend for communication.

Chapter 22, "Accessing SQL Server Databases Through Front-End Products" discusses the access of a SQL Server database through programming and non-programming applications. The chapter uses representative examples of the most prevalent client products.

Conventions Used in This Book

Que has over a decade of experience writing and developing the most successful computer books available. With that experience, we've learned what special features help readers the most. Look for these special features throughout the book to enhance your learning experience.

The following font conventions are used in this book to help make reading it easier.

  • Italic type is used to introduce new terms.

  • Screen messages, code listings, and command samples appear in monospace type. For more details about syntax, see the following section, Syntax Guidelines

  • Code that you are instructed to type appears in monospace bold type.

  • Shortcut keys are denoted with strikethrough. For example, "choose File, Edit" means that you can press Alt+F, then press E to perform the same steps as clicking on the File menu and the clicking on Edit.


    Tips present short advice on a quick or often overlooked procedure. These include shortcuts.


    Notes present interesting or useful information that isn't necessarily essential to the discussion. A note provides additional information that may help you avoid problems or offers advice that relates to the topic.


    Cautions look like this and warn you about potential problems that a procedure may cause, unexpected results, or mistakes to avoid.

This icon indicates you can also find the related information on the enclosed CD-ROM.

Syntax Guidelines

It's important to have a clearly defined way of describing Transact-SQL commands. In this book, the following rules apply:

  • Anything in italics means that you have to substitute the italicized text with your own text.

  • Anything placed inside square brackets "[ ... ]" means that it can be optionally left out of the command.

  • Anything placed inside curly braces "{ ... }" means that one of the values must be chosen to complete the syntax.

  • The available values are separated by the bar (or pipe) character "|" (meaning "OR"). Consider the following example:

    {DISK | TAPE | DISKETTE}
    It would be translated as "DISK or TAPE or DISKETTE."

  • Finally, if you see "..." after any bracketed block in a Transact-SQL statement, it means that section can be repeated as many items as is appropriate.


QUE Home Page

For technical support For our books And software contact support@mcp.com

Copyright © 1996, Que Corporation

Table of Contents

Welcome!

01 - Introducing Microsoft SQL Server