[dba-SQLServer] Using the CLR with SQL Server

Mark Breen marklbreen at gmail.com
Mon Sep 3 15:18:22 CDT 2012


Hello John,

Is it really faster to start up the CLR to process these one billion
records?  Is native SQL not faster?

I always assumed that you need to use the CLR inside SQL server when the
function is simply not available in TSQL.  I read an article years ago
where they did an MD5 hash within C#, but it was really a laboratory
example of how to do it.

I will be interested to see if the decision making process is faster with
C# inside SQL Server, vs plain ol' TSQL.

Of course embedded C# is more fun, so no complaint about doing it, just
curious.

What will be even more curious is where the cross over occurs ?

thanks

Mark


On 2 September 2012 18:22, jwcolby <jwcolby at colbyconsulting.com> wrote:

> I hate to say it but SQL Azure is just the cloud counterpart to SQL
> Server.  There are a millions of local SQL Server instances which can use
> help in things that TSQL is not optimized for.
>
> In my specific case today, I have a field in a table returned to me by
> third party software.  This field has one or more (up to 6 or 8 possibly)
> comma separated error codes.  I need to split these error codes and analyze
> them against a table of these error codes and make decisions about what to
> do with the record based on these codes.  Simple right?  Except I have to
> do this against a billion records a month.  Suddenly doing this the RBAR
> way or in fact any way which isn't waaaay speedy is a non-starter.
>
> C# is optimized for these kinds of string functions and can provide among
> the fastest possible solutions (or so I am reading).  As it happens, I do
> not use SQL Azure nor do I intend to anytime in the near future so I am not
> making decisions like this based on whether SQL Azure supports my solution.
>
> I think that you are right, it is not mainstream, though I suspect that
> much of the reason is that SQL Server types are not C# programmers and so
> it is not familiar to them.  As a developer with a foot in both camps it
> seems a natural fit for me.
>
>
> John W. Colby
> Colby Consulting
>
> Reality is what refuses to go away
> when you do not believe in it
>
> On 9/2/2012 4:32 AM, Adam Cogan www.ssw.com.au wrote:
>
>> It is definitely not mainstream John. None of our customers are using it.
>>
>> Now that it is not supported in SQL Azure I would *not* use it
>>
>> Adam Cogan www.ssw.com.au       www.twitter.com/adamcogan   +61 4 1985
>> 1995
>>
>> -- In Austria (no kangaroos here), then Germany, Bulgaria and Croatia
>> -- Sent from my super cool iPad 4 beta
>>
>>
>> On 2 Sep 2012, at 02:59 PM, "jwcolby" <jwcolby at colbyconsulting.com>
>> wrote:
>>
>>  Just a poll to see if anyone on the list is using the CLR in SQL Server.
>>>  I do a lot of C# work now and mostly to automate SQL Server.  I have not
>>> been using the CLR in SQL Server but I am ready to figure it out.
>>>
>>> Anyone?
>>>
>>> --
>>> John W. Colby
>>> Colby Consulting
>>>
>>> Reality is what refuses to go away
>>> when you do not believe in it
>>>
>>> ______________________________**_________________
>>> dba-SQLServer mailing list
>>> dba-SQLServer@**databaseadvisors.com<dba-SQLServer at databaseadvisors.com>
>>> http://databaseadvisors.com/**mailman/listinfo/dba-sqlserver<http://databaseadvisors.com/mailman/listinfo/dba-sqlserver>
>>> http://www.databaseadvisors.**com <http://www.databaseadvisors.com>
>>>
>>>
>> ______________________________**_________________
>> dba-SQLServer mailing list
>> dba-SQLServer@**databaseadvisors.com <dba-SQLServer at databaseadvisors.com>
>> http://databaseadvisors.com/**mailman/listinfo/dba-sqlserver<http://databaseadvisors.com/mailman/listinfo/dba-sqlserver>
>> http://www.databaseadvisors.**com <http://www.databaseadvisors.com>
>>
>>
>>
> ______________________________**_________________
> dba-SQLServer mailing list
> dba-SQLServer@**databaseadvisors.com <dba-SQLServer at databaseadvisors.com>
> http://databaseadvisors.com/**mailman/listinfo/dba-sqlserver<http://databaseadvisors.com/mailman/listinfo/dba-sqlserver>
> http://www.databaseadvisors.**com <http://www.databaseadvisors.com>
>
>


More information about the dba-SQLServer mailing list