Friday, March 30, 2012

Manage Permissions Script

How can I create a script that will set all the permissions for a specific user for some objects in a database?
Thx in advance.How can I create a script that will set all the permissions for a specific user for some objects in a database?
Thx in advance.

What kind of permissions are you trying to set? Are you trying to copy permissions from an existing user? Or are you trying to grant specific privileges on all objects? Or specific privileges on specific objects?

Please amplify your question a bit.

Regards,

hmscott|||I want to grant (or not) someprivileges on specific objects.
I made something like that:
GRANT SELECT ON [dbo].[AGENT] TO [web]
GO
DENY UPDATE , INSERT , DELETE ON [dbo].[AGENT] TO [web] CASCADE
GO

Actually, my problem is that I have to deploy my stored procedures on another server where these settings should be set up.
But it looks when I made my export to that server I lost the grants for my user.
That's why I thought it will be nice to have a script that will make the job automatically.
Anyway, I should change the way I made the export because I have checked up the option "Drop destinaton objects first".

No comments:

Post a Comment