Editorials

Pros and Cons of the CLR

SSIS Class – Online, 12 Hours/class sessions
(Only a couple of days left to register!)
Eric Johnson’s class starts July 1 and you can register now to attend! Brought straight to your desktop, this 12-session class includes weekly business hours with Eric, LOTS of information about SSIS and how you can put it to use in your own shop. There is SO MUCH information packed into this course, it’s unbelievable. Take a look at the class sessions here.

If you’re working with SSIS, or considering it, you can’t go wrong.

Featured Article(s)
10 Dev Mistakes (Part 1 of 6)
Things I wish I would have known when I got started doing development and doing T-SQL work. Things that I thought were going to work great and be just fine, and then only to find out that I had end users calling me like crazy, I had servers catching fire, because the things that I coded did not scale as well as I thought they would.

Free New Video Program Posted – Available Now
SelectViews – Information about the Best Practices Analyzer, Approaches to Working with Third-Party Applications and more. Devin Knight has our Guest Segment on today’s show.
[Watch the Show]

Pros and Cons of the CLR
The list servers have been hosting a great conversation about the CLR – and it’s evolved into a discussion about when to use, and not use, the CLR. I also have received some other comments from those using (or NOT) the CLR and thought it would be helpful to share this with everyone – some really great information here. Drop me an email with your take here.

The original question was pretty straightforward – from Gerald, "Can anyone tell me the downside of using SQL CLR? I’ve always heard that it’s a no-no. I’ve read articles that say it’s okay to use for certain types of logic."

Tom responded "I definitely do not agree that it is a no-no. There are some things that CLR languages are good at and some things that T-SQL is good at. You choose the tool for the job and neither use a screwdriver when you need a hammer or a hammer when you need a screwdriver. Generally, CLR languages are better at very complex calculations, most regular expression processing, and row by row processing. T-SQL is better at data accessing and processing that can be done with just declarative processing statements (select, insert, delete, update, merge) and worse at things that must be done procedurally (cursors, WHILE loops, etc).

A good discussion of advantages/disadvantages of CLR can be found at http://msdn.microsoft.com/en-us/library/ms345136%28SQL.90%29.aspx .

Full disclosure: I don’t write CLR’s myself. If I have a T-SQL problem that is better solved with a CLR procedure, I write up a spec and pass it off to someone else."

…and Ian writes "I fully agree with Tom: I would use T-SQL by default, with the exception of those things that T-SQL is poor at: String manipulation, intensive mathematical (or other cpu-intensive) processing, row-by-row processing and where your task necessitates a richer language set than T-SQL provides."

Stephen also jumped in (I am only including part of his post because it included code and such, too long for this space, get the entire post here) – "CLR should avoid CRUD type process in general. T-SQL is the choice for that.

Cursors and row level conditional processing is where CLR strong points are found.

From my POV I have the db engine bring up to my application the data I needed to process. From that new container in server ram I do whatever the requested output is and save whatever is needed back to the server.

As of now I still have never written CLR code to run in the DB. Now with Linq I can join different data objects in the Biz App (usually my WCF) to do what I need."

Free Webcast:
Using Log Shipping for High Availability

Log Shipping has been around in one form or another since SQL Server 2000 and many “homegrown†and third-party solutions have recently become available. This session will cover all you need to know about log shipping to use it effectively for high availability. We will look at set up, maintenance, monitoring, and failover. In addition, we will look at other SQL Server objects that you need to account for when using Log Shipping for HA. This session is for beginning to advanced SQL Server DBAs with little or no Log Shipping experience.
Presented by: Eric Johnson

> Register Now
> Live date: 7/14/2010 at 12:00 Pacific