From the course: SQL Server: Security for Developers

Unlock the full course today

Join today to access over 22,700 courses taught by industry experts or purchase this course individually.

Demo: Contained users

Demo: Contained users - SQL Server Tutorial

From the course: SQL Server: Security for Developers

Start my 1-month free trial

Demo: Contained users

- [Instructor] In this demo we're gonna show how to configure SQL Server for using contained database users. We're gonna walk through creating a database that takes advantage of this feature and we're also gonna create a database user and show you how to log in as one. The first thing we need to do with this feature is actually configure your SQL Server to make use of the feature. This isn't something that's turned on by default so I'm gonna use sp configure here. If you're using Management Studio, you right-click the server properties and choose Options but I like to do this via code just 'cause it's more consistent. So we've made that configuration and we'll go ahead and turn off Show Advanced Options. We're gonna start here on line 16 and we're gonna create a database called Demo Contained DB and the key thing here is on line 19 where we're specifying this option for the database, containment equals partial. That's the option that's gonna allow us to use contained users after we've…

Contents