Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
C# Assemblies on Sql Server
Message
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
C# 3.0
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01342551
Message ID:
01342702
Views:
21
>I have been playing with the capability of writing stored procedures and functions in C# and deploying them to the Sql Server 2005. This is pretty cool because I have a disdain for T-SQL outside of query syntax, but I have a question.
>
>I see that you have the ability to utilize arrays, .Net classes and such ( non-UI stuff ) in the assembly that you otherwise cannot use in T-SQL but I was wondering if you have access to all the functionality C# has to offer like generics, delegates, and so on? By what I have read and toyed with so far I think the answer is yes.
>
>Can I assume you are only hamstrung by the limitations you face in the debugging of the assembly at run-time? Depending on how complex you want to be I would think you could basically move tons of your business logic to the server and run it there, where as before we were returning datasets to the middle and performing further manipulations that we found easier to do in Fox/C# .
>
>Anyone know of some severe limitations that would keep you from using this feature fully?

Hi,
It's pretty neat - but MS only recommend using it when T-SQL can't do the job. Snip from http://msdn.microsoft.com/en-us/library/ms345136(SQL.90).aspx :

Even without CLR support, it is important to recognize that database applications should use the declarative query language as much as possible. This portion of the language is able to leverage the power of the query processor, which is best able to optimize and perform bulk operations. Database applications should only resort to procedural programming to express logic that cannot be expressed within the query language.

All of this remains true with CLR support in SQL Server: the CLR should not be used to write procedural code that can be expressed using the declarative features of the T-SQL language. Developers should be aware that there are a number of significant enhancements to the T-SQL query language in SQL Server 2005 that augment the expressive power of the T-SQL query language, and should ensure that they are taking full advantage of them before writing procedural code, whether in the CLR or not.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform