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.

❑ 4 — Thursday<br />

❑ 5 — Friday<br />

❑ 6 — Saturday<br />

❑ 7 — Sunday<br />

This can be really handy when dealing with localization issues, so you can properly layout any calendar<br />

or other day-of-week-dependent information you have.<br />

Use the SET DATEFIRST function to alter this setting.<br />

@@DBTS<br />

Returns the last used timestamp for the current database.<br />

At first look, this one seems to act an awful lot like @@IDENTITY in that it gives you the chance to get<br />

back the last value set by the system (this time, it’s the last timestamp instead of the last identity value).<br />

The things to watch out for on this one include:<br />

❑ The value changes based on any change in the database, not just the table you’re working on.<br />

❑ Any timestamp change in the database is reflected, not just those for the current connection.<br />

Because you can’t count on this value truly being the last one that you used (someone else may have<br />

done something that would change it), I personally find very little practical use for this one.<br />

@@LANGID and @@LANGUAGE<br />

Respectively return the ID and the name of the language currently in use.<br />

These can be handy for figuring out if your product has been installed in a localization situation or not,<br />

and if so, what language is the default.<br />

For a full listing of the languages currently supported by <strong>SQL</strong> <strong>Server</strong>, use the system stored procedure,<br />

sp_helplanguage.<br />

@@LOCK_TIMEOUT<br />

Apendix A: System Functions<br />

Returns the current amount of time in milliseconds before the system will time out waiting for a blocked<br />

resource.<br />

If a resource (a page, a row, a table, whatever) is blocked, your process will stop and wait for the block to<br />

clear. This determines just how long your process will wait before the statement is canceled.<br />

595

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

Saved successfully!

Ooh no, something went wrong!