Can call DLL from SQL Server?

Posted by Ray.chayan under Sql Server on 7/16/2010 | Views : 5450 | Status : [Member] | Replies : 3
Can I call DLL from SQL server? If yes the how?




Responses

Posted by: Raja on: 7/16/2010 [Member] Starter

Up
0
Down
What kind of .dll you want to call ? Can you elaborate more on what is the purpose of calling the .dll from Sql Server?

Regards,
Raja, USA

Ray.chayan, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: PandianS on: 7/16/2010 [Member] [MVP] Silver

Up
0
Down
Hi

YES. You can call .Dll from SQL Server by the following ways...

1. You can use "sp_addextendedproc" to register the .Dll in SQL Server and You can call the same from SQL Server.

use master
Go
sp_addextendedproc "FunctionName", "Dll Path"

Caution:
Using Extended Stored procedure is a "Deprecated Feature", So please don't follow this way...

2. You can create CLR Objects in .Net (Stored Procedure, Functions,....) and Register in on SQL Server as a ASSEMBLY and then you can uses the same.

Conclution:
Using CLR Assembly is the only recommended way to access the .Dll(s). So, Using the Extended Stored Procedure is the "Deprecated Feature", So please don't follow First way.

ie: CREATE ASSEMBLY....

Cheers


Cheers
www.SQLServerbuddy.blogspot.com
iLink Multitech Solutions

Ray.chayan, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Raja on: 7/16/2010 [Member] Starter

Up
0
Down
Excellent reply Pandians. I always follow your reply. Keep it up!



Regards,
Raja, USA

Ray.chayan, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response