views:

100

answers:

2

Having just finished writing a Regex replacement and match function and tvf for SQLCLR for the fifth time, I sat and pondered whether there was a set of common community extensions for SQLCLR for the most common things you want in a database but are never provided.

Powershell for example has an excellent set of community extensions that cover a plethora of additional functionality not included in the box. I wouldn't use Powershell without it.

I thought maybe SQLCLR had something similar. I'm looking for things like:

  • Regular expression support (isMatch, Replace, Match)
  • Base64 encode/decode support
  • String formatting (Datetimes, byte arrays, ints floats and decimals, etc)
  • Hashing, encryption with arbitrary algorithms (I know SQL 2k5, 2k8 support some basic stuff but no SHA2? What is up with that?)
  • Common additional aggregations; OR bits, AND bits, cat strings (String.Join)
  • Compression/decompression

Does anyone know of a library that has common routine functionality like this that we all write over and over again?

A: 

SplitString(), and many others could be added. Perhaps we create a SqlClrContrib site? Where people can post their ideas to an open source project and we can add such functions?

Andrew Siemer
There is one already http://www.sqlclr.net/ I started it over a year ago, and it never caught on.
Jonathan Kehayias
Well then...lets get some traffic going to it! Add it to your signature on this board to generate some traffic. Also, when people ask questions such as this you can point them there for their solution!
Andrew Siemer
Jonathan, I don't see any code projects here just several articles and howtos on SQLCLR integration.
Peter Oehlert
Anyone can create an account and contribute to the site. I really need to revitalize it because it was a fun thing that died off with time because it didn't take root.
Jonathan Kehayias
+1  A: 

Peter take a look at SQL# which is a SQLCLR Assembly created by Solomon Rutzky that has two versions, a FREE edition and a pay version. You will find that the FREE edition has a number of the items that you have mentioned above included.

http://www.sqlsharp.com/

Jonathan Kehayias