Pauldohert
Something in here
- Local time
- Today, 06:38
- Joined
- Apr 6, 2004
- Messages
- 2,101
I'm new to UDF s so to get me started how would this be done in from vba to T-SQL?
Is there somewhere online where I can see some examples of UDF in SQL server?
Thanks
Function CharConvert(strChar As String) As Integer
Select Case strChar
Case "A", "E", "I", "O", "U", "Y"
CharConvert = 0
Case "C", "G", "J", "K", "Q", "S", "X", "Z"
CharConvert = 2
Case "D", "T"
CharConvert = 3
Case "M", "N"
CharConvert = 5
Case "B", "F", "P", "V"
CharConvert = 1
Case "L"
CharConvert = 4
Case "R"
CharConvert = 6
Case Else
CharConvert = -1
End Select
End Function
Is there somewhere online where I can see some examples of UDF in SQL server?
Thanks
Function CharConvert(strChar As String) As Integer
Select Case strChar
Case "A", "E", "I", "O", "U", "Y"
CharConvert = 0
Case "C", "G", "J", "K", "Q", "S", "X", "Z"
CharConvert = 2
Case "D", "T"
CharConvert = 3
Case "M", "N"
CharConvert = 5
Case "B", "F", "P", "V"
CharConvert = 1
Case "L"
CharConvert = 4
Case "R"
CharConvert = 6
Case Else
CharConvert = -1
End Select
End Function