SQL CLR Integration in SQL Server 2008
Is some of your business logic in code and some in SQL Server? Then, just call the SQL from the .NET framework and the .NET framework from SQL with CLR integration. Here are all the steps you need to get started.