Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 Permissions to a role

Author  Topic 

steel
Posting Yak Master

107 Posts

Posted - 2010-08-19 : 05:54:40
Dear Experts,

We are using Sql server 2005+SP3 on windows server 2003.We have a database and a user(abc) defined for that database.we have generated a database role executesql and granted create table,create proc,execute proc to this role and added the user abc in the role executesql.But we want to give alter any user table to the role executesql in the specified database ,but we are not able to do so please help.

Thanks in advance.

jen
Master Smack Fu Yak Hacker

4110 Posts

Posted - 2010-08-19 : 09:43:05
try
grant alter on tablename to rolename

--------------------
keeping it simple...
Go to Top of Page

steel
Posting Yak Master

107 Posts

Posted - 2010-08-20 : 00:33:38
Thanks for the reply ,It is working ok but i want to provide the permission to all tables i;e whenever a new table is added ,the permission gets automatically assigned to role.
Go to Top of Page

jen
Master Smack Fu Yak Hacker

4110 Posts

Posted - 2010-08-20 : 08:37:32
you use a database trigger for that...on event that an object is created, execute grant permissions

--------------------
keeping it simple...
Go to Top of Page

jen
Master Smack Fu Yak Hacker

4110 Posts

Posted - 2010-08-20 : 08:38:23
or create a job that checks if a new table is created for that day (period of time) , then grant permissions

--------------------
keeping it simple...
Go to Top of Page
   

- Advertisement -