Re: Code in the database or middle tier (the CLR controversy)

From: Erland Sommarskog <esquel_at_sommarskog.se>
Date: Wed, 1 Jun 2005 22:08:53 +0000 (UTC)
Message-ID: <Xns966913971317Yazorman_at_127.0.0.1>


 (SAN3141_at_netscape.net) writes:
> There doesn't seem to be consensus about when to put code in the
> database or in the middle tier.

Indeed, there are different opinions on that one. Then again, it depends a little on your requirements. If portability is an issue, you need to abstract out the DB engine in some way, so you have more code in the middle tier. Then again, bouncing data forth and back, could be expensive, so it's natural to have the logic where the data is.

Not that this any much to do with CLR.

> Elsewhere there's been discussion about Microsoft SQL Server 2005
> adding the CLR to support stored procedures in languages such as C#. A
> scan of the Web and discussion forums finds differing opinions about
> this.

The CLR will be a very valuable addition to SQL Server, as it removes the need to use extended stored proceedures and OLE objects which in SQL 2000 can cause stability problems. The CLR is also good since complicated logic without data access in Transact-SQL can be implemented in a more effecient language.

But there is no doubt that the CLR will also be widely abused and a lot of code will be written in VB or C# which should have been written in T-SQL.

-- 
Erland Sommarskog, SQL Server MVP, esquel_at_sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinfo/productdoc/2000/books.asp
Received on Thu Jun 02 2005 - 00:08:53 CEST

Original text of this message