Using SQL Server 2005 CLR Features to Create Aggregates

Home > Blogs > Developer Visual Studio / ASP.NET > Using SQL Server 2005 CLR Features to Create Aggregates

Using SQL Server 2005 CLR Features to Create Aggregates

Like This Blog 0 Dan Wahlin
Added by September 27, 2006

I played around with SQL Server 2005 a bit this past week to explore (more in-depth) some of the different CLR features that are available.  I'll be posting a few of the things I've experimented with over the next few days.  One thing that can be really useful is the ability to create custom aggregate functions using C# or VB.NET, store them in the database and then use them within queries or stored procedures.

Jeff Jones (a SQL Server guru teaching at Interface Technical Training) and I were talking about the new Pivot functionality and how it was fairly painful to create the list of values to pivot on using pure T-SQL.  It can definitely be done, but is a bit "hacky" IMHO.  For example, the following query (which Jeff shared with me) could be used to dynamically grab the values to use as pivot columns.  The query relies upon XPath capabilities of SQL Server to create a list similar to "[2004],[2005],[2006]" and then uses that list in a pivot statement.


SQL Server 2005's CLR capabilities can definitely help simplify code and make it easier to do string manipulations plus much more.  I'll post some examples of using CLR functionality to grab RSS feeds from within SQL Server soon.  Thanks to Jeff Jones for sharing the original pivot example with me.

Videos You May Like

Agile Methodology in Project Management

0 171 0

In this video, you will gain an understanding of Agile and Scrum Master Certification terminologies and concepts to help you make better decisions in your Project Management capabilities. Whether you’re a developer looking to obtain an Agile or Scrum Master Certification, or you’re a Project Manager/Product Owner who is attempting to get your product or … Continue reading Agile Methodology in Project Management

Creating Users and Managing Passwords in Microsoft Office 365

0 745 4

In this Office 365 training video, instructor Spike Xavier demonstrates how to create users and manage passwords in Office 365.   For instructor-led Office 365 training classes, see our course schedulle: Spike Xavier SharePoint Instructor – Interface Technical Training Phoenix, AZ 20347: Enabling and Managing Office 365    

Windows 10 Features and Navigation – December 1, 2015

0 129 1

In this recorded Windows 10 webinar from December 1,2015, Windows Instructor Steve Fullmer presents the navigation and some of the new features associated with Windows 10 including Sysinternals Tools for Windows Client, Windows core concepts, exploring Process Explorer as well as some of the features that are not yet ready for prime time but will … Continue reading Windows 10 Features and Navigation – December 1, 2015

Write a Comment

Share your thoughts...

Please fill out the comment form below to post a reply.