SQL Server Questions and Answers – Row Level Security

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

Answer: b
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

Answer: c
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

Answer: a
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

Answer: c
Explanation: usp_GetSecLabelDetails generates the security label identifier and encryption objects for the specified label.

advertisement
advertisement

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

Answer: b
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

Answer: b
Explanation: fn_Dominates (Function) compares two labels and determines whether label A dominates label B.

Note: Join free Sanfoundry classes at Telegram or Youtube

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

Answer: d
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

Answer: c
Explanation: CertName field describes the security certificate name, to implement Cell Level Security.

advertisement

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

Answer: d
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

Answer: a
Explanation: Users can only access data through the stored procedures provided.

advertisement

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.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.