How to Map a User to an Existing Login in SQL Server - SQL Server DBA Tutorial

This video shows step by step process of mapping a user with an existing login using SQL Server Management studio as well as using T-SQL script. It also describes what are orphan users in SQL Server and how can you fix Orphan users in SQL Server. How to map multiple users to a single login. It also walk you through setting up default schema, default database and securables of a user in SQL Server database.

Script to Map a user to an Existing Login in SQL Server and Add to Role

USE [SalesOrders]
GO
 
CREATE USER [TECHBROTHERS\kscott] FOR LOGIN [TECHBROTHERS\kscott]
GO
 
USE [SalesOrders]
GO
 
ALTER ROLE [db_datareader] ADD MEMBER [TECHBROTHERS\kscott]
GO


Map a User to an Existing Login in SQL Server

1 comment:

  1. It also talks about best practices of providing permissions to a database user using securables as well as user window. It also demonstrates if underneath tables of a store procedure needs to be added in vidmate user permissions.

    ReplyDelete