Calling a Stored Procedure from a Stored Procedure

Calling a Stored Procedure from a Stored Procedure

Post by Michael Jenki » Fri, 19 Nov 1999 04:00:00



I have an Access Application which I am converting to SQL
Server.

I am hoping to duplicate some code which all the records in
in a table.

The The code is somthing like this

UPDATE Employee SET Password = encrypt(Password)

Here is the encrypt() Function Code.

Private Function encrypt(ByVal aString As String) As String

Dim ndx As Integer, encodedString As String, encodedValue As String

        encodedString = ""
        For ndx = 1 To Len(aString)
            encodedValue = Asc(Mid(aString, ndx, 1)) + 127
            If (encodedValue >= 0) And (encodedValue <= 255) Then
                encodedString = encodedString & Chr(encodedValue)
            End If
        Next

    encrypt = encodedString

End Function

How do I duplicate this functionality in a stored procedure?
Michael Jenkins
Control Tech Consulting Inc.
(905) 790-1507

http://www.interlog.com/~jenkinsm