Re: Permission to Insert records for DB USERS

From: Dan Guzman (danguzman@nospam-earthlink.net)
Date: 07/26/02


From: "Dan Guzman" <danguzman@nospam-earthlink.net>
Date: Fri, 26 Jul 2002 07:46:25 -0500


To add to the response by Vyas, consider creating your own database
roles and grant object permissions only to roles. This simplifies
administration because you to setup role security once and control
object access with role membership. The example below uses a
Transact-SQL script but you can accomplish the same result with
Enterprise Manager.

--setup role security
USE MyDatabase
EXEC sp_addrole 'Supervisors'
GRANT SELECT ON MyTable TO Supervisors
GRANT EXECUTE ON MyInsertProcedure TO Supervisors
GRANT EXECUTE ON MyUpdateProcedure TO Supervisors
GRANT EXECUTE ON MyDeleteProcedure TO Supervisors
EXEC sp_addrole 'Clerks'
GRANT SELECT ON MyTable TO Clerks
GO

--add logins
-- Windows logins
EXEC sp_grantlogin 'MyDomain\WindowsUser1'
EXEC sp_grantlogin 'MyDomain\WindowsUser2'
-- SQL logins
EXEC sp_addlogin 'SQLUser1', 'SQLUser1Password'
GO

--add users to database
EXEC sp_grantdbaccess 'MyDomain\WindowsUser1'
EXEC sp_grantdbaccess 'MyDomain\WindowsUser2'
EXEC sp_grantdbaccess 'SQLUser1'

--add users to roles roles
EXEC sp_addrolemember 'Supervisors', 'MyDomain\WindowsUser1'
EXEC sp_addrolemember 'Clerks', 'MyDomain\WindowsUser2'
EXEC sp_addrolemember 'Clerks', 'SQLUser1'
GO

--
Hope this helps.
Dan Guzman
SQL Server MVP
-----------------------
SQL FAQ links (courtesy  Neil Pike):
http://www.ntfaq.com/Articles/Index.cfm?DepartmentID=800
http://www.sqlserverfaq.com
http://www.mssqlserver.com/faq
-----------------------
"Shailesh" <shailesh@geminicorp.be> wrote in message
news:14dc01c2348a$9497c220$9ae62ecf@tkmsftngxa02...
> Dear Friends
>
> I am a fresh developer for the SQL server and have no Idea
> for the permissions on the database.
>
> I have created a database Master on which i can give the
> permission to the user to connect to the tables and to the
> database but the users are not able to insert or Update
> the records kindly suggest where i have to give the
> necessary permission so that my users can start inserting
> records.
>
> Your help in any positive dircetion for the solution of
> problem is needed.
>
> Best regards
> Shailesh
>


Relevant Pages

  • RE: user permissions in a database as a whole or tables
    ... user permissions in a database as a whole or tables ... The way to give permissions to a user is a simple GRANT. ...
    (comp.databases.informix)
  • Re: user permissions in a database as a whole or tables
    ... like PDF better but that was not helping this time either. ... user permissions in a database as a whole or tables ... The way to give permissions to a user is a simple GRANT. ...
    (comp.databases.informix)
  • Re: Permission in database
    ... You can create database roles and assign object permissions to these ... EXEC sp_addrole 'Administrators' ... GRANT SELECT, INSERT, UPDATE, DELETE ON Sales TO Administrators ...
    (microsoft.public.sqlserver.security)
  • Re: Permissions!
    ... be aware that 'dbo' is a special user that has full permissions. ... Database permissions are not checked for the 'dbo' user so it serves no ... You will need individual logins/users so that SQL Server can identify users ... EXEC sp_addrole 'Role1' ...
    (microsoft.public.sqlserver.security)
  • Re: Permissions on sp_OASetProperty
    ... this be setup with the least amount of permissions being given. ... chaining to allow limited access to the sp_OA* procs and other potentially ... dbo-owned objects in that database. ... EXEC sp_dboption 'MyDatabase', 'db chaining', true ...
    (microsoft.public.sqlserver.security)