You are on page 1of 1

Introduction Listing 0 Short Queries.

sql
-- Introduction Listing 0 Short Queries.sql for the Introduction
-- in the book SQL Server User-Defined Functions by Andrew Novick
-------

This file has some of the short queries that are listed in the chapter
so you don't have to type them. It does not have the scripts to create
functions or stored procedures. You can get them from the database
TSQLUDFS that accompanies the book. Also not included are some excerpts
from functions. They're for illustration purposes and I didn't intend
that you execute them.

------

Each of these queries is intended to be selected using Query Analyzer and


executed in the either TSQLUDFS database or the in the database that the
script moves to with the USE statement. The script many depend on the
existence of tables or functions not created in the chapter but already
in the target database.

-------

For best viewing, you should set Query Analyzer to display results in a grid.
You can make Grid the default by using the Tools->Options menu item, moving
to the results tab and selecting "Results to Grids" for the "Default results
target" dropdown at the top of the tab. You may also want to set the font
size to something moderate like 11 points. The queries often extend to
80 characters.

-- start in the TSQLUDFS database


USE TSQLUDFS
GO
-- short query to illustrate how Listing 0 files should be used.
SELECT 'Just a sample to show how the Listing 0 works'
GO

Page 1

You might also like