score:0

In Oracle, this is done via the 'GRANT' command. I don't know is SQL Server has GRANT

GRANT is used:

GRANT [permissions] ON TABLE to [user]

so

GRANT select, insert, update, delete ON TABLE to User2

score:0

In SQL Server, there are Server Logins and Database users. Try associated the Server Login to the specific database by:

Database > Security > Users > New User...

score:1

The logins need to be associated with the databases by creating database users mapping to the logins.

score:3

You can setup a security role granting privleges on tables, views, and their access all of that. Associate the user desired to the role you have created and you will get the desired result.

The following should create a role, login, user and provide SELECT only permission to the view in question. The same methods can be applied for whatever permissions you wish.

CREATE ROLE [db_views_role] AUTHORIZATION [dbo]
GO
GRANT SELECT ON [dbo].[vMyView] TO [db_views_role]
GO
CREATE LOGIN [my_login] WITH PASSWORD=N'PASSWORD', DEFAULT_DATABASE=[MyDatabase], CHECK_EXPIRATION=OFF, CHECK_POLICY=OFF
GO
CREATE USER [my_login] FOR LOGIN [my_login]
GO
EXEC sp_addrolemember N'db_views_role', N'my_login'
GO

More questions

More questions with similar tag