1 / 41
文档名称:

Sybex - Mastering Visual Basic .NET Transact SQL (VBL).pdf

格式:pdf   页数:41
下载后只包含 1 个 PDF 格式的文档,没有任何的图纸或源代码,查看文件列表

如果您已付费下载过本站文档,您可以点这里二次下载

Sybex - Mastering Visual Basic .NET Transact SQL (VBL).pdf

上传人:mkt365 2013/11/20 文件大小:0 KB

下载得到文件列表

Sybex - Mastering Visual Basic .NET Transact SQL (VBL).pdf

文档介绍

文档介绍:Bonus Reference
Transact-SQL
In Chapter 20, you built SQL statements to retrieve and update rows in a database. You
also learned all the variations of the SELECT statement. Some restrictions, however, can’t be
expressed with a WHERE clause, no matter plicated. To plicated searches,
many programmers would rather write an application to retrieve the desired rows, process them,
and then display some results. The processing could include running totals, formatting of the
query’s output, calculations involving multiple rows of the same table, and so on.
Most database management systems include extensions, which enhance SQL and make it
behave more like a programming language. SQL Server provides a set of statements known as
Transact-SQL (T-SQL). T-SQL recognizes statements that fetch rows from one or more tables,
flow-control statements like IF…ELSE and WHILE, and numerous functions to manipulate
strings, numeric values, and dates, similar to Visual Basic’s functions. With T-SQL you can do
everything that can be done with SQL, as well as program these operations. At the very least, you
can attach lengthy SQL statements to a database as stored procedures, so that you can call them by
name. In addition, you can use parameters, so that the same procedure can act on different data.
This chapter is an overview of T-SQL and demonstrates the basic topic with stored proce-
dures that plicated tasks on the server. We’ll start with PUTE BY state-
ment, which allows you to calculate totals on groups of the rows retrieved from the database.
This statement looks and feels very much like the straight SQL statements, yet it’s not part of
standard SQL.
Then we’ll look at T-SQL in depth. If you need to look up a function or how to declare a
stored procedure’s arguments, you can use this chapter as reference material. If you’re new to
T-SQL, you should read this material, because T-SQL is a powerful language, and if you’re
working with or plan to switch to SQL S