O'Reilly logo

Programming Microsoft® ADO.NET 2.0 Core Reference, 2nd Edition by David Sceppa

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Questions That Should Be Asked More Frequently

Q

Given a scenario that could be solved with either T-SQL or the SQL CLR, how should I determine which to use?

A

The best advice I can offer is this: when in doubt, write some proof-of-concept code, test it in an environment that will approximate the desired scenario, and see what happens. Take the prime-number-generating stored procedure as an example. For small sets of numbers, I expected that the two approaches would yield similar performance numbers and that the overhead of switching to the SQL CLR would be roughly equivalent to the overhead of creating the temporary table. For larger sets of numbers, I expected that the SQL CLR could would be more efficient. I further expected that as the size of ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required