• Bradley Deem (6/30/2010)


    chris.fauvel (6/30/2010)


    Bradley Deem (6/29/2010)


    I recommend using a CLR for this. Microsoft has a great example here http://msdn.microsoft.com/en-us/library/ms131056.aspx. I'm curious what the performance differences are. Admittedly, I have not compared the two because I've never had the CLR function not perform adequately.

    You can then use this as an aggregate, for example.

    SELECT dbo.List(myColumn)

    FROM myTable

    GROUP BY SomeOtherColumn

    What version of SQLSERVER are you running with CLR? Any issues with the server crashing? Could the server crash if the CLR has an unhandled exception?

    I see the power of CLR, but the boss and I are scared for the database.

    Thanks

    Chris

    CLR is just like any other feature. Spend some time researching the in and outs so you will be fine. In regards to your questions, this CLR function was implemented into 2005 and we recently upgraded to 2008 without any problems (in regards to the CLR). If your CLR throws an unhandled exception it will be returned to SQL; it will not crash your server. Of course, there are caveats, you could always build a CLR that could bring down a server, but I would find it hard to believe you'd knowingly put such volatile code in a CLR untested for production.

    On a side note, one of the changes to CLR in 2008 is removing the restriction of 8000 byte max. This means you could return a list of elements of size varchar(max).

    Unfortunately we are still at 2005, we have plans to go to 2008, but there is SOOOOO MUCH regression testing that it would preclude enhancements to the apps for several months. 🙁 ugh