Friday, February 24, 2012

Adding Execute permissions on Stored Procedures

How can i add Execute permissions on the Stored Procedures under the
created user permission iusing SQLDMO ?hi,
arfanameer@.hotmail.com wrote:
> How can i add Execute permissions on the Stored Procedures under the
> created user permission iusing SQLDMO ?

Dim oProcedure As SQLDMO.StoredProcedure
Dim oServer As SQLDMO.SQLServer
' connect to the server, etc...

'get a pointer to the procedure..
Set oProcedure = oServer.Databases("Pubs").StoredProcedures("byroyalty")
'grant EXEC permission to an existing user
oProcedure.Grant SQLDMOPriv_Execute, "user_name"

Set oProcedure = Nothing
Set oServer = Nothing

--
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz/DbaMgr.shtm http://italy.mvps.org
DbaMgr2k ver 0.10.0 - DbaMgr ver 0.56.0
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
--- remove DMO to reply

No comments:

Post a Comment