473,407 Members | 2,326 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

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,@encryptedvars 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(student_ssn,'000000000000000000000000 00000000') 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

Oct 3 '05 #1
2 3726
Object Owner...Object Owner

CREATE FUNCTION dbo.encrypt_pair (@data VARCHAR(14) , @key char(30) )
RETURNS VARCHAR (60) AS
BEGIN
DECLARE @encryptedvars VARCHAR(60)
EXEC master..xp_aes_encrypt @data,@key,@encryptedvars OUTPUT
RETURN @encryptedvars
END
select student_id, student_ssn,
dbo.encrypt_pair(student_ssn,'00000000000000000000 000000000000') from
student_ssn
--
--------------------------------
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland

IM: mi**@epprecht.net

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

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

"rcamarda" <rc******@cablespeed.com> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com...
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,@encryptedvars 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(student_ssn,'000000000000000000000000 00000000') 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

Oct 3 '05 #2
Thanks Mike, that thought never crossed my mind!

Oct 3 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: gyromagnetic | last post by:
Hi, I have written a function that searches a text string for various words. The text is searched using a boolean 'and' or a boolean 'or' of the input list of search terms. Since I need to use...
1
by: Saeed Amrollahi | last post by:
Dear All C++ Programmers Hello I am Saeed Amrollahi. I am a software engineer in Tehran Sewerage Company. I try to use std::map and map::find member function. I use Visual Studio .NET. my...
3
by: teddysnips | last post by:
In the script below is the DDL to create some tables and a UDF. What I'm interested in is the UDF at the end. Specifically, these few lines: --CLOSE OTRate --DEALLOCATE OTRate ELSE --...
1
by: jimfortune | last post by:
From: http://groups-beta.google.com/group/comp.databases.ms-access/msg/769e67e3d0f97a90?hl=en& Errata: 19 solar years = 2939.6018 days should be 19 solar years = 6939.6018 days Easter...
8
by: Ian Mackenzie | last post by:
Hi Guys I am VERY new to DB2 and have created a workingdays function to return the working days between 2 dates, but I get some compiler errors when running it: CREATE FUNCTION WORKINGDAYS...
6
by: rynato | last post by:
I am embarrassed that I cannot figure this out, as it seems fairly simple. I found a JS function I'd like to use, which animates a layer so that it moves across the screen. The problem is the...
4
by: spareforme | last post by:
Hi, fairly new to C programming. I have been asked to generate a list of numbers and store the prime ones in an array so that they can be then later printed out in columns. My generateprime...
28
by: gnuist006 | last post by:
I have some code like this: (if (test) (exit) (do something)) or (if (test)
2
by: dwasbig9 | last post by:
Hi Group (fairly limited knowledge of Access and almost none of Access VBA. Using Access 2003). I need to sum time, I've found through the groups archive an sql extract that led me to this ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.