How to Create an Application Role in a Database of SQL Server - SQL Server DBA Tutorial

In this video you will learn how to create Application Role in SQL Server database role using SQL Server management studio as well as using T-SQL Script. It also illustrates best practices of creating application role in SQL Server Database, when it is good idea to create application role and what types of application requires application role in SQL Server Database.

Script used to Create Application Role in a Database of SQL Server in this video

USE [SalesOrders]
GO
 

CREATE APPLICATION ROLE [AppReader] WITH DEFAULT_SCHEMA = [dbo], PASSWORD = N'Pa$$w0rd'GO 
USE [SalesOrders]
GO
 

ALTER AUTHORIZATION ON SCHEMA::[db_datareader] TO [AppReader]
GO

 USE [SalesOrders]
GO
 

GRANT SELECT ON [dbo].[Customers_3] TO [AppReader]
GO
 

USE [SalesOrders]
GO

 GRANT UPDATE ON [dbo].[Customers_3] TO [AppReader]
GO




Create an Application Role in a Database of SQL Server

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.