0

How can I create a User Defined Function UDF In SQL Server, I was looking for an example, Could you provide a very simple example using C#?

1 Answer 1

2

It's not possible. SQL Server 2008 contains SQL CLR runtime that runs .NET languages.

Sign up to request clarification or add additional context in comments.

3 Comments

So I can only use Visual Basic, C#?. In other SQL version, like 2000, or 2005 Is it possible?
Do you need it? If it's a function, it might be called for lots of rows and lots of times, and this approach might be slow... And you might get memory leaks and crash SQL Server. If you absolutely must call unmanaged code (C,C++) from inside SQL Server, call the code via P/Invoke from the C#/VB.NET assembly. See this thread for more info: social.msdn.microsoft.com/Forums/en/sqlnetfx/thread/…
I was planning to do an aggregate function, but for testing yield, i need to use a UDF.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.