In SQL server 2005 you can run .Net code within the DB-Server process (code name SQLCLR or integrated CLR).
The SQLCLR family include stored procedure, user defined function, aggregates, triggers and user-define types.
For example, you can create a user define aggregate which execute an operation on each row in the query result (this is a function like others system function: sum, average, count, min and max).
In my next post I'll show you an example to implement on of these functions.