0 votes

Hello,

A client on premise works with a 3rd party company for their telephony purposes. They need to store efficy data in their database for quick interaction with and from efficy to their communications system.

Not being able to use dumps (their system can't handle big files), we would like to give this client read-only access to a specific part of the database (in this case only 1 view).

I would prefer to do this with queries, so it can be used for other customers.

asked in Database by (201 points)

1 Answer

0 votes
Best answer

With the help of Kristof, this would be the commands to be used. Login and database name have to be replaced of course.

USE [master]
GO

-- Create new SQL Server login: Replace the database name [Efficy112] 
-- and select a good password
CREATE LOGIN [unify] WITH PASSWORD=N'***************', DEFAULT_DATABASE=[Efficy112], CHECK_EXPIRATION=OFF, CHECK_POLICY=OFF
GO

-- Replace the database name [Efficy112]
USE [Efficy112]
GO

-- Create a new user in the Efficy DB mapped with the SQL Server Login, 
-- select the default schema [admin]
CREATE USER [unify] FOR LOGIN [unify] WITH DEFAULT_SCHEMA=[admin]
GO

-- Grant only "select" permissions on the Unify view
GRANT SELECT ON [ADMIN].[CUSTOM_UNIFY_PHONES_EXPORT] TO [unify]
GO
answered by (201 points)
1,249 questions
1,521 answers
1,859 comments
328 users