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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

The SERVERPROPERTY function is very useful for multi-sited corporations where developers need to<br />

find out information from a server.<br />

SESSION_USER<br />

The SESSION_USER function allows a system-supplied value for the current session’s username to be<br />

inserted into a table if no default value has been specified. The syntax is as follows:<br />

SESSION_USER<br />

SESSIONPROPERTY<br />

The SESSIONPROPERTY function is used to return the SET options for a session. The syntax is as follows:<br />

SESSIONPROPERTY ()<br />

This function is useful when there are stored procedures that are altering session properties in specific<br />

scenarios. This function should rarely be used, as you should not alter too many of the SET options during<br />

run time.<br />

STATS_DATE<br />

The STATS_DATE function returns the date that the statistics for the specified index were last updated.<br />

The syntax is as follows:<br />

STATS_DATE(, )<br />

SYSTEM_USER<br />

The SYSTEM_USER function allows a system-supplied value for the current system username to be<br />

inserted into a table if no default value has been specified. The syntax is as follows:<br />

SYSTEM_USER<br />

USER_NAME<br />

The USER_NAME returns a database username. The syntax is as follows:<br />

USER_NAME([])<br />

Apendix A: System Functions<br />

The id parameter specifies the ID number of the required username; if no value is given the current user<br />

is assumed.<br />

647

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

Saved successfully!

Ooh no, something went wrong!