Reader small image

You're reading from  Professional Azure SQL Managed Database Administration - Third Edition

Product typeBook
Published inMar 2021
Reading LevelBeginner
PublisherPackt
ISBN-139781801076524
Edition3rd Edition
Languages
Tools
Concepts
Right arrow
Authors (2):
Ahmad Osama
Ahmad Osama
author image
Ahmad Osama

Ahmad Osama works for Pitney Bowes Pvt. Ltd. as a technical architect and is a former Microsoft Data Platform MVP. In his day job, he works on developing and maintaining high performant, on-premises and cloud SQL Server OLTP environments as well as deployment and automating tasks using PowerShell. When not working, Ahmad blogs at DataPlatformLabs and can be found glued to his Xbox.
Read more about Ahmad Osama

Shashikant Shakya
Shashikant Shakya
author image
Shashikant Shakya

Shashikant Shakya is a passionate technologist with decades of experience in the sphere of databases. He works for Microsoft as a senior support engineer. In his day job, he works on Azure SQL Database, Azure Database for MySQL, and PostgreSQL. Apart from his work, he is a regular speaker at the SQLBangalore community group.
Read more about Shashikant Shakya

View More author details
Right arrow

Activity: Implementing RLS

In this section, we will look at how to implement RLS using our example of ToyStore Ltd. Mike has been asked to implement RLS so that every customer is able to view and edit only their records. The CustomerAdmin user, however, should be allowed to view and edit all customer records. Follow these steps to complete the activity:

  1. Execute the following query to create the dpl.Customers table and populate it with sample records:
    CREATE TABLE Customers (
    CustomerID int identity, Name sysname, CreditCardNumber varchar(100), Phone varchar(100), Email varchar(100)
    )
    Go
    INSERT INTO Customers VALUES('Mike',0987654312345678,9876543210,'mike@
    outlook.com'), ('Mike',0987654356784567,9876549870,'mike1@outlook.
    com'), ('Mike',0984567431234567,9876567210,'mike2@outlook.com'), (' john@dpl.com ',0987654312345678,9876246210,'john@outlook.com'),
    ('john@dpl.com ',0987654123784567,9876656870...
lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Professional Azure SQL Managed Database Administration - Third Edition
Published in: Mar 2021Publisher: PacktISBN-13: 9781801076524

Authors (2)

author image
Ahmad Osama

Ahmad Osama works for Pitney Bowes Pvt. Ltd. as a technical architect and is a former Microsoft Data Platform MVP. In his day job, he works on developing and maintaining high performant, on-premises and cloud SQL Server OLTP environments as well as deployment and automating tasks using PowerShell. When not working, Ahmad blogs at DataPlatformLabs and can be found glued to his Xbox.
Read more about Ahmad Osama

author image
Shashikant Shakya

Shashikant Shakya is a passionate technologist with decades of experience in the sphere of databases. He works for Microsoft as a senior support engineer. In his day job, he works on Azure SQL Database, Azure Database for MySQL, and PostgreSQL. Apart from his work, he is a regular speaker at the SQLBangalore community group.
Read more about Shashikant Shakya