-----------------------------------------------------------------------------
/*
SQL Server در Execution Plan آشنایی با مفهوم  
Site:        http://www.NikAmooz.com
Instagram:   https://instagram.com/nikamooz/
Telegram:	 https://telegram.me/nikamooz
Created By:  Iman Bagheri
*/
-----------------------------------------------------------------------------

USE [master]
GO
DROP LOGIN [usertest]
GO
USE [AdventureWorksDW2019]
GO
DROP USER IF EXISTS [usertest]
GO

 
 
USE [master]
GO
CREATE LOGIN [usertest] WITH PASSWORD=N'123', DEFAULT_DATABASE=[master], CHECK_EXPIRATION=OFF, CHECK_POLICY=OFF
GO
USE [AdventureWorksDW2019]
GO
CREATE USER [usertest] FOR LOGIN [usertest]
GO
USE [AdventureWorksDW2019]
GO
ALTER ROLE [db_datareader] ADD MEMBER [usertest]
GO


USE [AdventureWorksDW2019]
GO
GRANT SHOWPLAN TO [usertest]
GO
