Get SQL Server version, Application Name With a Query

In this article I am going to explain about methods to get information about server you are using.
  • 2172

Introduction

There is a way to determine the version of SQL Server Version, Application Name and additional information.

For Example

1. Query to find out the SQL Server Version

select @@VERSION

Output:

GetVersion-of-SQL.jpg
 

This returns the complete string "Microsoft SQL Server 2008 R2 (RTM) - 10.50.1600.1 (Intel X86) Apr 2 2010 15:53:02 Copyright (c) Microsoft Corporation Enterprise Edition on Windows NT 5.1 <X86> (Build 2600: Service Pack 3)". But to find individually the particular property.

2. Get the product version

select SERVERPROPERTY ('productversion')

Output:

GetProductVersion.jpg
 

3. APP_Name() Function

This function returns the name of application which starts the database connection. This function is useful in various conditions like, some problem occurs in initiating database connection and you want to determine which application initiates process. Lets see practical example:

select APP_Name() as ApplicationName

Output:

ApplicationName.jpg
 

4. Get additional details about the server

In above examples we determine individual information,  but if we want to all information about the server. Type following code:

exec xp_msver

Execute this stored procedure.

Output:

AdditionalInfo-in-sql.jpg


Categories

More Articles

© 2018 DotNetHeaven. All rights reserved.