Link to home
Start Free TrialLog in
Avatar of MrDavidThorn
MrDavidThorn

asked on

Converting VBA to TSQL help required!

Hi Experts Im converting some VBA code to TSQL, nearly there just having a problem with using functions.

Although the VBA I want to use is a bit more complex then what I want to use below in essence its what I want to achieve.

I know I can use insert/update statements in functions in TSQL, so I guess it must be a procedure with (multiple) return parameters.

Please some one help!
Sub psMy_Procedure()
Dim strName As String
strName = "Dave"
pfMy_ReuturnProcedure strName
MsgBox strName
End Sub

Function pfMy_ReuturnProcedure(strSirName As String)
strSirName = "Thorn"
'Then do some funky insert SQL statement here

End Function

Open in new window

Avatar of MrDavidThorn
MrDavidThorn

ASKER

Im thinking I need to use output parmeters in stored procdures. How do I use stored procduers with multple outputs
ASKER CERTIFIED SOLUTION
Avatar of Bitsqueezer
Bitsqueezer
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You can create User Defined functions ( that have one or more input parameters) and return a value in exactly the same manner as you would create a VBA Function. These can be called in views, stored procedures etc..


Kelvin