my new function not found

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • rcamarda

    my new function not found

    I issue this command in QA:
    CREATE FUNCTION encrypt_pair (@data VARCHAR(14) , @key char(30) )
    RETURNS VARCHAR (60) AS
    BEGIN
    DECLARE @encryptedvars VARCHAR(60)
    EXEC master..xp_aes_ encrypt @data,@key,@enc ryptedvars OUTPUT
    RETURN @encryptedvars
    END

    If I run it again, I get an error that it already exists (duh).
    Next I run:

    select student_id, student_ssn,
    encrypt_pair(st udent_ssn,'0000 000000000000000 0000000000000') from
    student_ssn

    and I get the error:
    Server: Msg 195, Level 15, State 10, Line 1
    'encrypt_pair' is not a recognized function name.
    I don't get whats wrong!
    Thanks
    Rob

  • Mike Epprecht \(SQL MVP\)

    #2
    Re: my new function not found

    Object Owner...Object Owner

    CREATE FUNCTION dbo.encrypt_pai r (@data VARCHAR(14) , @key char(30) )
    RETURNS VARCHAR (60) AS
    BEGIN
    DECLARE @encryptedvars VARCHAR(60)
    EXEC master..xp_aes_ encrypt @data,@key,@enc ryptedvars OUTPUT
    RETURN @encryptedvars
    END


    select student_id, student_ssn,
    dbo.encrypt_pai r(student_ssn,' 000000000000000 000000000000000 00') from
    student_ssn


    --
    --------------------------------
    Mike Epprecht, Microsoft SQL Server MVP
    Zurich, Switzerland

    IM: mike@epprecht.n et

    MVP Program: http://www.microsoft.com/mvp

    Blog: http://www.msmvps.com/epprecht/

    "rcamarda" <rcamarda@cable speed.com> wrote in message
    news:1128344611 .711934.195110@ g43g2000cwa.goo glegroups.com.. .[color=blue]
    >I issue this command in QA:
    > CREATE FUNCTION encrypt_pair (@data VARCHAR(14) , @key char(30) )
    > RETURNS VARCHAR (60) AS
    > BEGIN
    > DECLARE @encryptedvars VARCHAR(60)
    > EXEC master..xp_aes_ encrypt @data,@key,@enc ryptedvars OUTPUT
    > RETURN @encryptedvars
    > END
    >
    > If I run it again, I get an error that it already exists (duh).
    > Next I run:
    >
    > select student_id, student_ssn,
    > encrypt_pair(st udent_ssn,'0000 000000000000000 0000000000000') from
    > student_ssn
    >
    > and I get the error:
    > Server: Msg 195, Level 15, State 10, Line 1
    > 'encrypt_pair' is not a recognized function name.
    > I don't get whats wrong!
    > Thanks
    > Rob
    >[/color]


    Comment

    • rcamarda

      #3
      Re: my new function not found

      Thanks Mike, that thought never crossed my mind!

      Comment

      Working...