For windows account
CREATE LOGIN [BNS\EPMDataReaders] FROM WINDOWS WITH DEFAULT_DATABASE=[AssetMgmtServicesReport], DEFAULT_LANGUAGE=[us_english]
USE AssetMgmtServices;
CREATE USER [BNS\EPMDataReaders] FOR LOGIN [BNS\EPMDataReaders]
GRANT SELECT ON [dbo].AssetInventory TO [BNS\EPMDataReaders]
GRANT SELECT ON [dbo].Region TO [BNS\EPMDataReaders]
GRANT EXECUTE ON dbo.fnLocationString TO [BNS\EPMDataReaders]
GRANT EXECUTE ON dbo.fnFormatFloor TO [BNS\EPMDataReaders]
USE AssetMgmtServicesReport;
CREATE USER [BNS\EPMDataReaders] FOR LOGIN [BNS\EPMDataReaders]
GRANT SELECT ON dbo.fnGreenIT_GetAssets TO [BNS\EPMDataReaders]
GRANT SELECT ON dbo.GreenITCategoryMapper TO [BNS\EPMDataReaders]
GRANT SELECT ON dbo.GreenITCategory TO [BNS\EPMDataReaders]
GRANT EXEC ON dbo.GreenIT_GetAssets_YYMM TO [BNS\EPMDataReaders]
USE master
CREATE USER [BNS\EPMDataReaders] FOR LOGIN [BNS\EPMDataReaders]
EXEC sp_addrolemember N'security_role', N'BNS\EPMDataReaders'
For local sql account
CREATE LOGIN [GreenItUser] WITH PASSWORD=N'Scotia123', DEFAULT_DATABASE=[AssetMgmtServicesReport], DEFAULT_LANGUAGE=[us_english], CHECK_EXPIRATION=OFF, CHECK_POLICY=OFF
USE AssetMgmtServices;
CREATE USER [GreenItUser] FOR LOGIN [GreenItUser]
GRANT SELECT ON [dbo].AssetInventory TO [GreenItUser]
GRANT SELECT ON [dbo].Region TO [GreenItUser]
GRANT EXECUTE ON dbo.fnLocationString TO [GreenItUser]
GRANT EXECUTE ON dbo.fnFormatFloor TO [GreenItUser]
USE AssetMgmtServicesReport;
CREATE USER [GreenItUser] FOR LOGIN [GreenItUser]
GRANT SELECT ON dbo.fnGreenIT_GetAssets TO [GreenItUser]
GRANT SELECT ON dbo.GreenITCategoryMapper TO [GreenItUser]
GRANT SELECT ON dbo.GreenITCategory TO [GreenItUser]
GRANT EXEC ON dbo.GreenIT_GetAssets_YYMM TO [GreenItUser]
USE master
CREATE USER [GreenItUser] FOR LOGIN [GreenItUser]
EXEC sp_addrolemember N'security_role', N'GreenItUser'
CREATE LOGIN [BNS\EPMDataReaders] FROM WINDOWS WITH DEFAULT_DATABASE=[AssetMgmtServicesReport], DEFAULT_LANGUAGE=[us_english]
USE AssetMgmtServices;
CREATE USER [BNS\EPMDataReaders] FOR LOGIN [BNS\EPMDataReaders]
GRANT SELECT ON [dbo].AssetInventory TO [BNS\EPMDataReaders]
GRANT SELECT ON [dbo].Region TO [BNS\EPMDataReaders]
GRANT EXECUTE ON dbo.fnLocationString TO [BNS\EPMDataReaders]
GRANT EXECUTE ON dbo.fnFormatFloor TO [BNS\EPMDataReaders]
USE AssetMgmtServicesReport;
CREATE USER [BNS\EPMDataReaders] FOR LOGIN [BNS\EPMDataReaders]
GRANT SELECT ON dbo.fnGreenIT_GetAssets TO [BNS\EPMDataReaders]
GRANT SELECT ON dbo.GreenITCategoryMapper TO [BNS\EPMDataReaders]
GRANT SELECT ON dbo.GreenITCategory TO [BNS\EPMDataReaders]
GRANT EXEC ON dbo.GreenIT_GetAssets_YYMM TO [BNS\EPMDataReaders]
USE master
CREATE USER [BNS\EPMDataReaders] FOR LOGIN [BNS\EPMDataReaders]
EXEC sp_addrolemember N'security_role', N'BNS\EPMDataReaders'
For local sql account
CREATE LOGIN [GreenItUser] WITH PASSWORD=N'Scotia123', DEFAULT_DATABASE=[AssetMgmtServicesReport], DEFAULT_LANGUAGE=[us_english], CHECK_EXPIRATION=OFF, CHECK_POLICY=OFF
USE AssetMgmtServices;
CREATE USER [GreenItUser] FOR LOGIN [GreenItUser]
GRANT SELECT ON [dbo].AssetInventory TO [GreenItUser]
GRANT SELECT ON [dbo].Region TO [GreenItUser]
GRANT EXECUTE ON dbo.fnLocationString TO [GreenItUser]
GRANT EXECUTE ON dbo.fnFormatFloor TO [GreenItUser]
USE AssetMgmtServicesReport;
CREATE USER [GreenItUser] FOR LOGIN [GreenItUser]
GRANT SELECT ON dbo.fnGreenIT_GetAssets TO [GreenItUser]
GRANT SELECT ON dbo.GreenITCategoryMapper TO [GreenItUser]
GRANT SELECT ON dbo.GreenITCategory TO [GreenItUser]
GRANT EXEC ON dbo.GreenIT_GetAssets_YYMM TO [GreenItUser]
USE master
CREATE USER [GreenItUser] FOR LOGIN [GreenItUser]
EXEC sp_addrolemember N'security_role', N'GreenItUser'