Skip to Main Content
Professional Microsoft® SQL Server® 2008 Reporting Services
book

Professional Microsoft® SQL Server® 2008 Reporting Services

by Paul Turley, Thiago Silva, Bryan C. Smith, Ken Withee
December 2008
Beginner to intermediate content levelBeginner to intermediate
815 pages
20h 1m
English
Wrox
Content preview from Professional Microsoft® SQL Server® 2008 Reporting Services

Appendix C. T-SQL System Variables and Functions

Variables and functions are often used interchangeably. SQL Server Books Online documents some variables as though they were functions. However, it's important to note that variables are used in expressions to obtain a value, whereas functions process specific business logic and may return a value. Many functions accept input arguments.

This Appendix, specific for SQL Server 2008, is not meant to be a comprehensive reference, but to provide a convenient guide to many functions and variables. For complete details and samples of usage, consult Books Online.

System Global Variables

The system-supplied global variables are organized into the following categories:

  • Configuration

  • Cursor

  • System

  • System Statistics

Configuration

Variable

Return Type

Description

@@DATEFIRST

tinyint

The system setting for the first day of the week:

  • 1 = Monday

  • 2 = Tuesday

  • 3 = Wednesday

  • 4 = Thursday

  • 5 = Friday

  • 6 = Saturday

  • 7 = Sunday

  • The U.S. default is 7.

@@DBTS

varbinary

The last assigned unique TimeStamp value

@@LANGID

smallint

The current language ID for the server:

  • 0 = US English

  • 1 = German

  • 2 = French ...

  • and so on.

@@LANGUAGE

nvarchar

The current language string for the server. Returns the language name in the native language form (us_english, Deutsch, Français, Dansk, Español, Italiano, etc.).

@@LOCK_TIMEOUT

int

Lock time-out setting for the current session in milliseconds (ms)

@@MAX_CONNECTIONS

int

The maximum concurrent connections setting for the server

@@MAX_PRECISION

tinyint

The maximum precision ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Microsoft® SQL Server® 2008 Reporting Services Step by Step

Microsoft® SQL Server® 2008 Reporting Services Step by Step

Stacia Misner
Beginning, Microsoft® SQL Server® 2008 Administration

Beginning, Microsoft® SQL Server® 2008 Administration

Chris Leiter, Dan Wood, Albert Boettger, Michael Cierkowski
Professional SQL Server™ 2005 Integration Services

Professional SQL Server™ 2005 Integration Services

Brian Knight, Allan Mitchell, Darren Green, Douglas Hinson, Kathi Kellenberger, Andy Leonard, Erik Veerman, Jason Gerard, Haidong Ji, Mike Murphy

Publisher Resources

ISBN: 9780470242018Purchase book