From the course: SQL Server 2008 Essential Training

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Using SQL configuration functions

Using SQL configuration functions - SQL Server Tutorial

From the course: SQL Server 2008 Essential Training

Start my 1-month free trial

Using SQL configuration functions

Some of the simplest functions to begin with are just using the configuration functions. These allow us to get information like the server name and the version and the connections that have occurred since this server was last booted up. If I am going to write an SQL statement to read them, I still need to have a good old SELECT statement here because that's how we fetch information. Well, what I'm interested in is things like the server name. I'm going to do the two @ signs because most of the configuration functions are the ones without parentheses that begin with two @ signs. I use my trusty IntelliSense and I've got quite a few. There is about 30 something to choose from. Lets take a little look at @ sign. @@SERVERNAME. Now you'll notice that I'm not saying use AdventureWorks because doesn't really matter where I am. This functions is going to execute and return the name of my standalone PC here, which is just SIMON-PC. I could do @@VERSION to find the version of SQL Server that is…

Contents