none
LINQ in CLR Integration RRS feed

  • Question

  • Hi,

    I have a database project and I want to use LINQ to SQL functionality in a custom function written in the database project.  Is this supported currently.  When I try to add the reference to the database project I cannot even see the System.Data.LINQ assemblies in them.

    Thanks
    Arjuna.
    Saturday, May 10, 2008 4:28 AM

Answers

  • LINQ to SQL is not supported in the SQL Server Integrated CLR, which means that it hasn’t been tested exhaustively and it can behave unexpectedly.

    In SQL Server 2008, System.Core.dll and System.Xml.Linq.dll are going to be added to the short list of supported assemblies, which implies basic LINQ (i.e. LINQ to Objects) and LINQ to XML support.

    For your own testing purposes, in order to register other assemblies to work in the integrated CLR you can use the CREATE ASSEMBLY command and register them as UNSAFE.

    Hope this helps,

    -diego

    Sunday, May 11, 2008 1:43 AM

All replies

  • LINQ to SQL is not supported in the SQL Server Integrated CLR, which means that it hasn’t been tested exhaustively and it can behave unexpectedly.

    In SQL Server 2008, System.Core.dll and System.Xml.Linq.dll are going to be added to the short list of supported assemblies, which implies basic LINQ (i.e. LINQ to Objects) and LINQ to XML support.

    For your own testing purposes, in order to register other assemblies to work in the integrated CLR you can use the CREATE ASSEMBLY command and register them as UNSAFE.

    Hope this helps,

    -diego

    Sunday, May 11, 2008 1:43 AM

  • LINQ to SQL does allow you to invoke stored procedures implemented in managed code.

    You need .NET Framework 3.5 (Visual Studio 2008) to be able to use LINQ to SQL.

    Hope that helps,

    --Samir

    Sunday, May 11, 2008 2:07 AM
  • Hi Diego,

    I understand its been a while since the post.. I am trying to enable Linq to Objects in my 2008 SQL CLR project. How exactly would I do that? Do i need to install a particular SP  to enable Linq support?

     

    Thanks,

    Orry

    Wednesday, March 31, 2010 5:31 PM