Collections:
Suser_Sname() - Sever Level Security Principal of Your Session in SQL Server
What Is the Security Principal at the Server Level That Represents Your Session in SQL Server?
✍: FYIcenter.com
Security principal identifies who you are when you interact with the SQL Server. What can do you at the server level solely depends on the security principal that represents you. So it is very important to know your security principal at the server level.
What is the server level security principal of your session? The answer is simple - the login name you used to connect to the server to start the session. For example, if you connects to the server with the login name "sa", then your security principal is "sa" at the server level.
On a Unix system, there is a nice command called "whoami" which returns your security principal on the system. SQL Server provides a similar function called Suser_Sname(), which returns your security principal (a login name) at the server. Try it by following this tutorial example:
-- Find out your security principal at the server level PRINT Suser_Sname(); GO sa
This example shows you that you used "sa" as the login name to connect to the server.
⇒ User_Name() - Database Level Security Principal of Your Session in SQL Server
⇐ Security Principals Used in SQL Server 2005 in SQL Server
2016-10-20, 1899👍, 0💬
Popular Posts:
How To Drop an Index in Oracle? If you don't need an existing index any more, you should delete it w...
What Is SQL*Plus in Oracle? SQL*Plus is an interactive and batch query tool that is installed with e...
How to change the data type of an existing column with "ALTER TABLE" statements in SQL Server? Somet...
What is dba.FYIcenter.com Website about? dba.FYIcenter.com is a Website for DBAs (database administr...
What is SQL Server Transact-SQL (T-SQL)? SQL Server Transact-SQL, also called T-SQL, is an extension...