O'Reilly logo

Professional Microsoft® SQL Server® 2008 Programming by Mahsa Nakhjiri, Rob Vieira

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Appendix A. System Functions

SQL Server includes a number of "System Functions" as well as more typical functions with the product. Some of these are used often and are fairly clear right from the beginning in terms of how to use them. Others, though, are both rarer in use and more cryptic in nature.

In this appendix, we'll try to clarify the use of most of these functions in a short, concise manner.

Just as an FYI, in prior releases, many system functions were often referred to as "Global Variables." This was a misnomer, and Microsoft has striven to fix it over the last few releases — changing the documentation to refer to them by the more proper "System Function" name. Just keep the old terminology in mind in case any old fogies (such as myself) find themselves referring to them as Globals.

The T-SQL functions available in SQL Server 2008 fall into 14 categories:

  • Legacy "system" functions

  • Aggregate functions

  • Configuration functions

  • Cryptographic functions

  • Cursor functions

  • Date and time functions

  • Mathematical functions

  • Metadata functions

  • Ranking functions

  • Rowset functions

  • Security functions

  • String functions

  • System functions

  • Text and image functions

In addition, we have the OVER operator, which largely works as a ranking tool, and can be applied to other forms of T-SQL functions (most notably aggregates). While I only discuss it as part of the ranking functions, you may see it referenced several other places in this appendix.

Legacy System Functions (a.k.a. Global Variables)

@@CONNECTIONS

Returns the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required