views:

932

answers:

1

I've got a c# class library that I call from an asp.net application. The assembly calculates grades for students and performs calculations using datatables and such.

How can I use this assembly in SQL Server 2005 and call it once for each record in a database table? I want to re-use functionality and avoid writing the thing in T-SQL.

+2  A: 

To use .Net assemblies in SQL Server you need to enable CLR Integration in SQL server. This section on MSDN has some good examples.

As you have the logic already in .Net wouldn't it be better to do all the work there? As your application grows you'll be much better off keeping all you business logic in code and using the database as a store of data.

Keith Bloom
+1 for advice to keep processing out of DB.
David Waters