sql master
The master database in SQL Server is the most important system database for a SQL Server instance. In short, it's like the central brain of SQL Server, housing all of its own information.
Sql Server Version
SELECT @@VERSION;
Sql Server Name
SELECT @@SERVERNAME;
sys.server_principals
SELECT @@VERSION;
SELECT @@SERVERNAME;
sys.server_principals
Lists all login information defined in the SQL Server instance. This query shows you the basic security structure of your server and allows you to check who has access to the system, the status of their accounts and other relevant details.
SELECT * FROM sys.server_principals WHERE type IN ('S', 'U');