17.06.2013 Views

Beginning Microsoft SQL Server 2008 ... - S3 Tech Training

Beginning Microsoft SQL Server 2008 ... - S3 Tech Training

Beginning Microsoft SQL Server 2008 ... - S3 Tech Training

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

❑ NEWID<br />

❑ NULLIF<br />

❑ PARSENAME<br />

❑ PERMISSIONS<br />

❑ ROWCOUNT_BIG<br />

❑ SCOPE_IDENTITY<br />

❑ SERVERPROPERTY<br />

❑ SESSION_USER<br />

❑ SESSIONPROPERTY<br />

❑ STATS_DATE<br />

❑ SYSTEM_USER<br />

❑ USER_NAME<br />

APP_NAME<br />

The APP_NAME function returns the application name for the current session if one has been set by the<br />

application as an nvarchar type. It has the following syntax:<br />

CASE<br />

APP_NAME()<br />

The CASE function evaluates a list of conditions and returns one of multiple possible results. It also has<br />

two formats:<br />

❑ The simple CASE function compares an expression to a set of simple expressions to determine<br />

the result.<br />

❑ The searched CASE function evaluates a set of Boolean expressions to determine the result.<br />

Both formats support an optional ELSE argument.<br />

Simple CASE function:<br />

CASE <br />

WHEN THEN <br />

ELSE <br />

END<br />

Searched CASE function:<br />

CASE<br />

WHEN THEN <br />

ELSE <br />

END<br />

Apendix A: System Functions<br />

639

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!