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
 General SQL Server Forums
 Script Library
 UDF Execute Permissions

Author  Topic 

ang
Starting Member

2 Posts

Posted - 2007-01-15 : 08:29:06
Help i need somebody.

I am trying to loop through & set execute permission on some UDFS but I cannot find an option for UDF's.

Private mobjSQL As SQLDMO.SQLServer
Dim objDB As SQLDMO.Database


Private Sub GrantUDF()

Dim objDB As SQLDMO.Database
Dim objUDFS As UserDefinedFunctions
Dim objUDF As SQLDMO.UserDefinedFunction
Dim lngUDFCount As Long
Dim lngProg As Long

For Each objDB In mobjSQL.Databases
If ListItemChecked(Me.lstDatabases, objDB.Name) Then
lngUDFCount = objDB.????????????????????
lngProg = 0
For Each objUDF In objDB.??????????????????
GeneralProgress objUDF.Name, 0, lngUDFCount, lngProg
objUDF.Grant SQLDMOPriv_Execute, "AGDB"
lngProg = lngProg + 1
Next
GeneralProgress "Finished", 0, lngUDFCount, lngProg
End If
Next

End Sub

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2007-01-15 : 08:35:25
Please post your questions in appropriate forums. This forum is designed to share innovative working SQL scripts (as an archive of SQL Scripts) and not for posting questions.

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page
   

- Advertisement -