Solved

What are the disadvantges in executing .net assembly in SQL Server ?

Posted on 2014-10-27
5
120 Views
Last Modified: 2014-11-25
Is it a good practice to execute the .net  assembly through SQL server ?
0
Comment
Question by:Varshini S
  • 2
  • 2
5 Comments
 
LVL 40

Assisted Solution

by:Jacques Bourgeois (James Burger)
Jacques Bourgeois (James Burger) earned 125 total points
ID: 40407210
They are slower than straight SQL.

Their role is not to replace SQL, they are there to provide a way to perform operations that cannot be done or are hard to do from SQL, such as Office interop.
0
 
LVL 40

Assisted Solution

by:Kyle Abrahams
Kyle Abrahams earned 125 total points
ID: 40407373
Also it depends on if you own the DLL or not.  If you don't own the DLL (eg: you didn't compile the source to generate that DLL) you're trusting the user who provided the DLL that it's going to do what they say it will do.

There are ways around that (eg: de-compiling to verify) but it's a disadvantage in my mind.

Also to elaborate on why they are slower the DB has to load the dll into memory, then invoke the function in the CLR.  It also doesn't perform any kind of performance tuning or optimizations.

Lastly RAM usage could be another disadvantage (eg: the assembly will take up RAM space).
0
 
LVL 70

Assisted Solution

by:Éric Moreau
Éric Moreau earned 250 total points
ID: 40408120
0
 
LVL 40

Expert Comment

by:Kyle Abrahams
ID: 40412016
Eric . . . where do you cover the advantages / disadvantages?
0
 
LVL 70

Accepted Solution

by:
Éric Moreau earned 250 total points
ID: 40412284
I don't have a section specific for pros/cons. I warn that SQL statements will always be faster then your CLR code.
0

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question