Home » SQL Server » SQL Server Configuration Functions

SQL Server Configuration Functions

SQL Configuration functions

Some useful SQL Server configuration functions are:

@@SERVERNAME, @@VERSION, @@SPID & @@LANGUAGE




1. @@SERVERNAME:

This function returns local server name that is currently running SQL Server.

Syntax:

SELECT @@SERVERNAME AS 'Current Server Name'
SQL Configuration function- @@ServerName

SQL Configuration function – @@SERVERNAME

2. @@VERSION:

It is used to return current SQL Server version details like Edition, Installation date, Operating system version, Processor architecture and Copyright statement.

Syntax:

SELECT @@VERSION AS 'SQL Server Version'
SQL Configuration function - @@VERSION

SQL Configuration function – @@VERSION



3. @@SPID:

It is used to return currently running SQL Server Session id.

Syntax:

SELECT @@SPID AS 'SPID', 
SYSTEM_USER AS 'LoginName', 
USER AS 'UserName';




4. @@LANGUAGE:

It is used to return the name of the language that is currently used in SQL Server.

Syntax:

SELECT @@LANGUAGE AS 'Language Name'
SQL server configuration function- @@Language

SQL Server function – @@Language



Hope you enjoyed the post. Your valuable feedback, question, or comments about this post are always welcome or you can leave us message on our contact form , we will revert to you asap.

Recommended SQL Server Post:

SQL REPLICATE() function

SQL IDENTITY Functions

Query Optimization Technique in SQL Server

SQL Commands

Identity functions in SQL Server

SQL Keys

Alter table statement

Leave a Reply