Editorials

Editorial Thoughts for Today

What to do with SQL CLR
There are a lot of things much easier, or more efficient, when done in SQL Server using the CLR.
Here are some of the ones I have done.

Most of these were done before SQL Server 2008. Some are redundant with features available in SQL Server 2008, but only ship with the Enterprise or higher version. Some could have been done in TSQL; others were done in the CLR for performance reasons, primarily string based work.

  • Calculate Erlang. An Erlang is a measurement for the number of phone lines a company should have statistically to reduce the probability of an incoming call receiving a busy signal
  • Median aggregate
  • Convert character data to a comma separated list
  • Convert comma separated list in a string into a table
  • Compress/Decompress data
  • Encrypt/Decrypt data
  • Format Dates Funtion
  • User Defined Types
    • Date (no time segment)
    • Small Date (No time segment)

As you can see I don’t use the CLR a lot, since this is my comprehensive list since CLR code was released to SQL Server in 2005.

How about you? What CLR routines have you created that are not specific to your data alone, working generically?

Why not drop me a note with useful ideas for the CLR in SQL Server.

Cheers,

Ben

SSWUGtv
With Stephen Wynkoop
Did you catch this episode yesterday as Steve takes on the difficult task of cleaning data. No? Then now you can watch as Steve interviews key players in the data cleansing world.
Watch the Show

$$SWYNK$$

Featured White Paper(s)
All-At-Once Operations
Written by Itzik Ben-Gan with SolidQ

SQL supports a concept called all-at-onc… (read more)

Featured Script
dba3_DeleteTopByIncrements_demo
Requires TOP (variable) support of 2k5 & later – demo script… (read more)