What Is the Security Principal at the Server Level That Represents Your Session?
Submitted by: AdministratorSecurity 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.
Submitted by: Administrator
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.
Submitted by: Administrator
Read Online MS SQL Server Job Interview Questions And Answers
Top MS SQL Server Questions
☺ | How To Sort Query Output in Descending Order in MS SQL Server? |
☺ | What Happens If NULL Values Are Involved in Arithmetic Operations? |
☺ | What Is a Transact-SQL Statement Batch in MS SQL Server? |
☺ | What Are Binary String Data Types in MS SQL Server? |
☺ | How To Convert a Numeric Expression from One Data Type to Another? |
Top Databases Programming Categories
☺ | RDBMS Interview Questions. |
☺ | SQL Interview Questions. |
☺ | SSRS Interview Questions. |
☺ | Database Administrator (DBA) Interview Questions. |
☺ | Sybase Interview Questions. |