SQL Server @@Servicename

SQL @@servicename is SQL Server configuration function which returns the name of the registry key under which SQL Server is running.





This function does not require any argument, you can simply use it in a select statement to return the registry key’s name.

It returns ‘MSSQLSERVER’ if the current instance is the default instance.

SYNTAX

@@servicename

Lets look at an example of SQL Server @@servicename.

Following SQL Statement uses @@servicename function which returns the name of SQL Server service which is currently running.

SELECT @@SERVICENAME AS [Service Name]

You can also read following SQL Configuration function.

SQL Server @@VERSION

SQL Server @@SPID

SQL Server @@Language



SQL Basics TutorialSQL Advance TutorialSSRSInterview Q & A
SQL Create tableSQL Server Stored ProcedureCreate a New SSRS Project List Of SQL Server basics to Advance Level Interview Q & A
SQL ALTER TABLESQL Server MergeCreate a Shared Data Source in SSRSSQL Server Question & Answer Quiz
SQL DropSQL Server PivotCreate a SSRS Tabular Report / Detail Report
..... More.... More....More
Power BI TutorialAzure TutorialPython TutorialSQL Server Tips & Tricks
Download and Install Power BI DesktopCreate an Azure storage accountLearn Python & ML Step by stepEnable Dark theme in SQL Server Management studio
Connect Power BI to SQL ServerUpload files to Azure storage containerSQL Server Template Explorer
Create Report ToolTip Pages in Power BICreate Azure SQL Database ServerDisplaying line numbers in Query Editor Window
....More....More....More




 10 total views,  2 views today

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.