please forget that one :-)
Main Topics
Browse All TopicsIt seems obvious that SQL-DMO comes into play. But before I bite off all that for the first time, is this a reasonable idea?
I have a VB.NET function that RC4-encrypts/decrypts values.
I want to call it from a SQL 2000 UDF as in:
Create Function dbo.udfDecodeSSN
(
@ID BigInt
)
Returns VarChar(9)
As
Return
(
Select
DoRC4 ( dbo.Employee.SSN ) as SSN /* Note the function call here */
From
dbo.Employees
Where
dbo.Employees.ID = @ID
)
/* Something like that */
DoRC4() is a VB.NET (2003) function. The password/encryption key is embedded in it and the .dll created from it is required to run the UDF.
So, is that going to work, and if so, could I get a clue as to calling my .NET function from the UDF?
THANKS!
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
I thought that sp_OACreate was designed to allow us to call external DLL/ActiveX [functions/methods/classes
As in this example from the EE link below it:
EXEC @hr = sp_OACreate 'DynCrypto.Crypto', @object OUT
http://www.experts-exchang
Where 'DynCrypto.Crypto' is such and ActiveX component.
>> you cannot call a .NET function from a UDF in SQL Server 2000.
What am I missing here?
Thanks!
>I thought that sp_OACreate was designed to allow us to call external DLL/ActiveX [functions/methods/classes
yes, but you cannot call those procedures from within functions.
if you really want to use the external functions, you have to use a stored procedure instead of a stored function.
no way around that.
Business Accounts
Answer for Membership
by: angelIIIPosted on 2006-05-10 at 10:24:13ID: 16650720
udf cannot be called like stored procedures, but need to be used in queries:
select * from dbo.udfDecodeSSN(2389238)