Book Image

SQL Server on Linux

Book Image

SQL Server on Linux

Overview of this book

Microsoft's launch of SQL Server on Linux has made SQL Server a truly versatile platform across different operating systems and data-types, both on-premise and on-cloud. This book is your handy guide to setting up and implementing your SQL Server solution on the open source Linux platform. You will start by understanding how SQL Server can be installed on supported and unsupported Linux distributions. Then you will brush up your SQL Server skills by creating and querying database objects and implementing basic administration tasks to support business continuity, including security and performance optimization. This book will also take you beyond the basics and highlight some advanced topics such as in-memory OLTP and temporal tables. By the end of this book, you will be able to recognize and utilize the full potential of setting up an efficient SQL Server database solution in your Linux environment.
Table of Contents (19 chapters)
Title Page
Credits
About the Author
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface

Row-level security


This feature is new, starting from version SQL Server 2016. Row-level security was a security challenge for a long time. It was implemented through different sets of add-ons and tools. However, this is now built into the database engine and SQL language. Imagine this scenario: a sales person has read permission on the Sales table, but you want each sales person to only see their own sales records, and the manager should see all the records. If you look at this problem through the classic user-permission chain, it is impossible to implement it. However, the row-level security feature makes it possible.

Let's see how it works:

1> USE Sandbox2> GO--Create three users without logins1> CREATE USER Manager WITHOUT LOGIN;2> CREATE USER Sales1 WITHOUT LOGIN;3> CREATE USER Sales2 WITHOUT LOGIN;4> GO
-- Create Sales table1> CREATE TABLE Sales(2> OrderID int,3> SalesRep sysname,4> Product varchar(10),5> Qty int )6> GO-- Add some sample data1>...