June 20, 2002 at 9:51 pm
Are User Defined Functions exposed via SQLDMO Object Model?
If so where can I find them?
thx
Brian Lockwood
President
LockwoodTech Software
Brian Lockwood
President
ApexSQL - SQL Developer Essentials
June 21, 2002 at 4:30 am
Try UserDefinedFunctions Collection of the database object - SQL2K only of course.
Andy
June 21, 2002 at 7:44 am
quote:
Try UserDefinedFunctions Collection of the database object - SQL2K only of course.Andy
http://www.sqlservercentral.com/columnists/awarren/
thanks - I found it in help file now but it does not show up in intellisense when interrogating the component in VB. and fails when I attempt to access the collection. Could I be using the wrong version of sqldmo in VB - an older version that does not support tuserdefinedfunctions?
I am using SQLDMO.dll 2000.80.194.0
Brian Lockwood
President
LockwoodTech Software
Brian Lockwood
President
ApexSQL - SQL Developer Essentials
June 21, 2002 at 8:08 am
This works using 2000.80.532.0
Dim oServer As SQLDMO.SQLServer
Dim oDB As SQLDMO.Database2
Dim oFunc As SQLDMO.UserDefinedFunction
Set oServer = New SQLDMO.SQLServer
oServer.LoginSecure = True
oServer.Connect "higapp4"
Set oDB = oServer.Databases("Train01")
For Each oFunc In oDB.UserDefinedFunctions
Debug.Print oFunc.Name
Next
Set oDB = Nothing
oServer.DisConnect
Set oServer = Nothing
Andy
June 21, 2002 at 11:54 am
quote:
This works using 2000.80.532.0Dim oServer As SQLDMO.SQLServer
Dim oDB As SQLDMO.Database2
Dim oFunc As SQLDMO.UserDefinedFunction
Set oServer = New SQLDMO.SQLServer
oServer.LoginSecure = True
oServer.Connect "higapp4"
Set oDB = oServer.Databases("Train01")
For Each oFunc In oDB.UserDefinedFunctions
Debug.Print oFunc.Name
Next
Set oDB = Nothing
oServer.DisConnect
Set oServer = Nothing
Andy
http://www.sqlservercentral.com/columnists/awarren/
is there a version of SQLDMO for morons? I think I may need to start using this version instead 🙂
thx for the help - you guys always bail me out on DMO questions.
Brian Lockwood
President
LockwoodTech Software
Brian Lockwood
President
ApexSQL - SQL Developer Essentials
June 21, 2002 at 12:39 pm
No problem at all - wish we had more DMO questions!
Andy
June 28, 2002 at 8:33 pm
ok - here is one ... (this issue was my problem)
what is the difference between SQLDMO.Database2 and SQLDMO.Database.
Using Database UserDefinedFunctions are not exposed but using Database2 they are.
Can I assume Database2 is for SQL2000 and Database is for SQL7?
Brian Lockwood
President
LockwoodTech Software
Brian Lockwood
President
ApexSQL - SQL Developer Essentials
June 29, 2002 at 5:30 am
Thats correct. All the "2" objects have additional SQL2K functionality. They've preserved the original interface so that existing code didnt break.
Andy
June 29, 2002 at 9:49 am
quote:
Thats correct. All the "2" objects have additional SQL2K functionality. They've preserved the original interface so that existing code didnt break.Andy
http://www.sqlservercentral.com/columnists/awarren/
thanks for the reply - this makes sense.
I have one more question and should finish things on this thread. I have no experience with UDFs but have read a little about them in last couple of days. Can you tell me whether or not a User Defined Function can be called from the following objects
- Stored Procedure Y/N
- Another User Defined Function Y/N
- View
- External Client app directly such as a .vbs file using ADO (I believe answer to this is yes)
Brian Lockwood
President
LockwoodTech Software
Brian Lockwood
President
ApexSQL - SQL Developer Essentials
June 29, 2002 at 10:24 am
Answer should be yes to all.
Andy
June 29, 2002 at 11:25 am
quote:
Answer should be yes to all.Andy
http://www.sqlservercentral.com/columnists/awarren/
ok thanks - you've been a great help
Brian Lockwood
President
LockwoodTech Software
Brian Lockwood
President
ApexSQL - SQL Developer Essentials
Viewing 11 posts - 1 through 10 (of 10 total)
You must be logged in to reply to this topic. Login to reply