views:

1288

answers:

3

I have an SQL Server 2005 server, and I'd like to run a .Net CLR stored procedure on it. However, I'd like to use .NET Framework 3.5.

If I try this right now, I get this error:

Error: Assembly 'system.core, version=3.5.0.0, culture=neutral, publickeytoken=b77a5c561934e089.' was not found in the SQL catalog.

I'm told this is possible in SQL Server 2008, because SQL Server 2008 ships with .NET Framework 3.5. However, I'm wondering if there's a way to add .NET Framework 3.5 to my SQL Server 2005 installation, so that I can run .NET 3.5 stored procedures on it.

+3  A: 

This might be a stupid question but... If system.core can't be found, do you have the framework 3.5 installed on the database server?

Barry Fandango
Well, I don't actually have access to check...I figured I'd ask before putting in a request.Is it really just as simple as installing the .net 3.5 runtime?
Pandincus
That would be a minimum requirement. How did you expect it to work if 3.5 wasn't installed?
RoadWarrior
+1  A: 

This thread might be helpful to you.

RoadWarrior
A: 

The result of google + trial & error

EXEC dbo.sp_changedbowner @loginame = N'sa', @map = true
GO
sp_configure 'clr enabled', 1
GO
RECONFIGURE
GO
ALTER DATABASE [MyDB] SET TRUSTWORTHY ON
GO
CREATE ASSEMBLY [System.Core]
AUTHORIZATION [dbo]
FROM 
'C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\System.Core.dll'
WITH PERMISSION_SET = UNSAFE
GO

Sites:

Scott Weinstein