— Enable contained database authentication

sp_configure ‘contained database authentication’, 1;
GO
RECONFIGURE
GO

— Create Database with User & Password stored in the database itself.

CREATE DATABASE [MyConAuthDB] CONTAINMENT=PARTIAL
GO

USE [MyConAuthDB]
GO

CREATE TABLE baseTable(id int, [name] varchar (255))
GO

CREATE USER testuser1 WITH PASSWORD = N’password’, DEFAULT_SCHEMA=[dbo]
GO

EXEC sp_addrolemember’db_owner’, ‘testuser1’
GO