2

Are normal operations like:

DELETE From Product where ProductId = x faster in CLR then normal MS SQL 2005 Server Stored Procedures?

2
  • Can you be more specific? Are you measuring overall time (including AppDomain warmup), or just once everything has been loaded (e.g. execution plan in the SP version)? Commented Jun 15, 2010 at 12:36
  • I am trying to optimize stored procedures, so they execute faster and less taxing. Commented Jun 15, 2010 at 12:40

3 Answers 3

3

No.

The general recommendation is to continue to use T-SQL for set based operations, and only consider using CLR for compute-bound tasks (or tasks for which there is no T-SQL equivalent).

See, for example, this MS white paper

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

Comments

0

The short answer is no. While the difference may be so minute you would never be able to tell a stored procedure written in native T-SQL is going to be faster than one written in C# that has to be compiled into MSIL to run.

You should only do CLR stored procedures if you can't feasibly do something using native T-SQL. For instance I have a CLR procedure that works with EDI and I have to do a large amount of text processing and that is not very feasible using T-SQL.

Comments

0

Nope. Actually its faster to use stored procedure, since not every statement is recompiled on each use.

Comments

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.