Do you have a comment or suggestion to improve SQL Server? We’d love to hear it!

Add server-side compilation ability to SQL CLR

The current model in which a developer generates an assembly and then passes it to a DBA and says "trust me" is failing to allow for the typical dynamics involved. To the DBA, this assembly is like a black box.

Also, the current model ties databases directly to versions of the .NET Framework. While there is currently only a single supported version of this now, this won't remain the case and will lead to a versioning mess in the future. DBA's won't want to hear about things like publisher policies, etc. or whatever will be required to deal with it.

Further, the current model requires a DBA to be comfortable with Visual Studio, even when implementing what would otherwise be simple managed code functions. This is harming SQL CLR adoption.

If the managed code source was processed when scripting a database instead of the assembly binaries, much of these issues would be avoided.

1 vote
Sign in
or sign in with
    Password icon
    Signed in as (Sign out)

    We’ll send you updates on this idea

    AdminMicrosoft SQL Server (Product Manager, Microsoft Azure) shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

    Upvotes: 76

    <=-=Mar 25 2007 8:51PM=-=>

    The one remaining issue would be how to implement assembly references. I think that the default assembly could already have the references that are the default ones when you currently start a database project in Visual Studio. Other references required by the function (or procedure or type, etc.) could be passed like this:


    alternately, something like:

    ALTER ASSEMBLY default ADD REFERENCE ‘reference goes here’

    <=-=Aug 20 2007 2:34PM=-=>

    Hi Greg,

    First of all i would like to thank you for the detailed feedback and articulating the need for this feature. We have heard several requests on this in the past and we are looking at it closely and will try to enable it in a future release.

    Vineet Rao
    Program Manager
    SQL Server Engine

    <=-=Aug 31 2008 6:19AM=-=>

    See also “Write Routines Directly in .NET Languages” (, which is the same thing with a different suggested syntax.

    <=-=Nov 1 2011 1:33PM=-=>

    This will make life so much easier it’s tough to explain. Working with 11 server trying to keep clr libraries in synch, half the time things are smooth the other half makes me think if it was worth it.
    Not needing to deploy assembly will be awesome.

    <=-=Mar 31 2015 6:02AM=-=>

    I too want this. There is another post asking for this ability in another way here:
    Please see my comments there.

    <=-=Mar 5 2017 2:56PM=-=>

    Yep. Highly wanted. But 10 years from the report…


    Sign in
    or sign in with
      Password icon
      Signed in as (Sign out)

      Feedback and Knowledge Base