• Categories

  • Recent Posts

  • Archives

  • Copyright Notice

    Copyright © Nancy Hidy Wilson, 2010-2013. Unauthorized use and/or duplication of this material without express and written permission from this blog’s author and/or owner is strictly prohibited. Excerpts and links may be used, provided that full and clear credit is given to Nancy Hidy Wilson and nancyhidywilson.wordpress.com with appropriate and specific direction to the original content.

TSQL2sday #024 – Prox ‘n’ Funx


What is TSQL2sday? Two years ago, Adam Machanic (blog | twitter) had this brilliant idea for a monthly SQL Server blogger event (the origin of TSQL2sday).  This month’s event is hosted by Brad Schulz (blog) and the selected topic is “Prox ‘n’ Funx” (aka Procedures and Functions).

Today, I’m sharing my favorite SQL Server metadata function – SERVERPROPERTY(‘propertyname’).  This handy function has been around since at least SQL Server 2000. If you need to get a quick “report” of the high level configuration information about your SQL Server instance – this is the function to use. Of course, with each new version of SQL Server it is subject to change, so always check usage in BOL (this link is to SQL 2008 R2 Books Online, but you can get to other versions from there).

If a property isn’t valid for a particular version of SQL Server (or if you just flat out typo the property name!), then NULL will be returned. Here’s a sample query for you to try out.  

And if you need database property info – guess what?  There are DATABASEPROPERTY and DATABASEPROPERTYEX functions you should check out! Until next time – happy TSQL2sday!


					
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: