This set of SQL Server Multiple Choice Questions & Answers (MCQs) focuses on “Row Level Security”.
1. Which of the following condition in the where clause will return the login identification name of the user?
a) UserName = SUSER_NAME()
b) UserName = SUSER_SNAME()
c) UserName = CURRENT_USER()
d) UserName = USER()
View Answer
Explanation: USER_NAME or CURRENT_USER Return the database user name.
2. Point out the correct statement.
a) Implementing row level security based on security labels is possible in SQL Server 2008
b) A security label is a marking that describes the securable content of an item
c) Row-level permissions are used for applications that store information in a single table
d) None of the mentioned
View Answer
Explanation: SQL Server does not have support for implementing row-level security. You must create additional columns in your tables that define row filtering mechanisms.
3. View that contains the list of all the security labels present in the database are __________
a) vwVisibleLabels
b) VisibleLabels
c) vwVisibleLabel
d) All of the mentioned
View Answer
Explanation: The purpose of vwVisibleLabels view is to enforce the row security by joining it with the base table.
4. Which of the following retrieves a SecurityLabel instance describing the subject label of the current database user?
a) fn_Dominates
b) usp_GetUserLabel
c) usp_GetCurrentUserLabel
d) usp_GetSecLabelDetails
View Answer
Explanation: usp_GetSecLabelDetails generates the security label identifier and encryption objects for the specified label.
5. Point out the wrong statement.
a) usp_EnableCellVisibility opens all the symmetric keys that are mapped to security labels
b) usp_DisableCellVisibility opens all the symmetric keys that were previously opened
c) On SQL Server 2012 you can use the Contained Database feature to create a user without a login
d) No arguments are available for usp_EnableCellVisibility
View Answer
Explanation: usp_DisableCellVisibility (Stored Procedure) closes all the symmetric keys that were previously opened by calling usp_EnableCellVisibility.
6. What will the fn_Dominates return if A dominates B where A and B both are security label?
a) 0
b) 1
c) NULL
d) None of the mentioned
View Answer
Explanation: fn_Dominates (Function) compares two labels and determines whether label A dominates label B.
7. The major components of the Label Security Toolkit are _____________
a) Documentation
b) The Label Policy Designer application
c) Examples showing the implementation of row- and cell-level security in different scenarios
d) All of the mentioned
View Answer
Explanation: The Label Security Toolkit provides tools and techniques for using Microsoft® SQL Server (versions 2005 through 2012) to implement row-level security (RLS) and cell-level security (CLS) based on security labels.
8. Return type of CertName field in vwVisibleLabels is __________
a) XML
b) INT
c) NVARCHAR(256)
d) VARCHAR(256)
View Answer
Explanation: CertName field describes the security certificate name, to implement Cell Level Security.
9. Which of the following will not return user name of the current session?
a) CUURENT_USER()
b) USER_NAME()
c) CUSER_NAME()
d) None of the mentioned
View Answer
Explanation: All of the specified functions will return user name.
10. Grant ________ permission on the stored procedures to database roles for implementing call level security.
a) EXECUTE
b) EXEC
c) READ
d) WRITE
View Answer
Explanation: Users can only access data through the stored procedures provided.
Sanfoundry Global Education & Learning Series – SQL Server.
To practice all areas of SQL Server, here is complete set of 1000+ Multiple Choice Questions and Answers.
- Check Information Technology Books
- Apply for Programming Internship
- Practice Programming MCQs
- Check SQL Server Books