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.

@@VERSION<br />

Returns the current version of <strong>SQL</strong> <strong>Server</strong> as well as the processor type and OS architecture.<br />

For example:<br />

gives:<br />

SELECT @@VERSION<br />

-----------------------------------------------------------------------------<br />

<strong>Microsoft</strong> <strong>SQL</strong> <strong>Server</strong> <strong>2008</strong> (RTM) - 10.0.1600.22 (X64)<br />

Jul 9 <strong>2008</strong> 14:17:44<br />

Copyright (c) 1988-<strong>2008</strong> <strong>Microsoft</strong> Corporation<br />

Developer Edition (64-bit) on Windows NT 6.0 (Build 6001: Service Pack 1)<br />

(1 row(s) affected)<br />

Unfortunately, this doesn’t return the information into any kind of structured field arrangement, so you<br />

have to parse it if you want to use it to test for specific information.<br />

Consider using the xp_msver system sproc instead — it returns information in such a way that you can<br />

more easily retrieve specific information from the results.<br />

Cryptographic Functions<br />

These are functions that help support the encryption, decryption, digital signing, and digital signature<br />

validation. Some of these are new with <strong>SQL</strong> <strong>Server</strong> <strong>2008</strong>, and some came with <strong>SQL</strong> <strong>Server</strong> 2005. Notice<br />

that there are duplicates of most functions from a general use point of view, but that they are different in<br />

that one supports a symmetric key and the duplicate (usually with an “Asym” in the name) supports an<br />

asymmetrical key.<br />

Now, you may ask “why would I need these?” The answer is as varied as the possible applications for<br />

<strong>SQL</strong> <strong>Server</strong>. The quick answer though is this: Any time you’re sending or accepting data that you want<br />

to protect during transport. For example, since <strong>SQL</strong> <strong>Server</strong> supports HTTP endpoints, and, from that,<br />

hosting of its own web services, you may want to accept or return encrypted information with a client of<br />

your web service. Perhaps a more basic example is simply that you’ve chosen to encrypt the data in your<br />

database, and now you need to get it back out in a useful manner.<br />

AsymKey_ID<br />

Given the name of an asymmetric key, this function returns an int that corresponds to the related ID<br />

from the database. The syntax is simple:<br />

AsymKey_ID(‘’)<br />

You must have permissions to the key in question to use this function.<br />

Apendix A: System Functions<br />

599

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

Saved successfully!

Ooh no, something went wrong!