dealing with .dll files after creating Assembly

Hi

I want to use CLR for developing database object such as stored procedures.

I have read the "Getting Started with CLR Integration" from MSDN help and successfully create my first procedure.

I create an assembly in SQLServer2005 with this code:

CREATE ASSEMBLY helloworld from 'c:\helloworld.dll' WITH PERMISSION_SET = SAFE

My questions are :

How should I deal with helloworld.dll after creating Assembly

Can I delete this file

What should I do for uploading my application on the webserver

Should I upload any .dll file



Answer this question

dealing with .dll files after creating Assembly

  • Tarek Haoula

    Yes, Your Answer helped me.

    Thank you very much.


  • Bene

    How should I deal with helloworld.dll after creating Assembly

    Check it into a source control system.

    Can I delete this file

    Yes you could.

    When you call create assembly is does several things but two of which are:

    • perform checks on assembly
    • upload assembly into system tables (sys.assembly_files.content)

    So when you backup and restore, attach/detach etc your assembly goes with your DB which is a good thing. My last point here is that you can optionally upload your source for sqlclr assemblys via alter assembly and alter assembly can be used to "refresh" your assembly in the DB. This was brought up in a presentation I did on SQLCLR recently, see my blog for more info (http://derekcomingore.iuplog.com/default.asp item=159198).

    Should I upload any .dll file

    No, the answer is that once is loaded into the DB the dll file can be dealt with however you see fit (but I would personally keep it somewhere safe just in case).

    What should I do for uploading my application on the webserver

    I am assuming your overall question here is in regard to deployment of SQLCLR.

    You can deploy sqlclr assemblies via the following ways:

    • Generate SQL Scripts for your assemblies. Create Assembly with <assembly bits> will be generated
    • Backup/Restore of DB
    • Attach/Detach Db

    Hope this helps,

    Derek


  • dealing with .dll files after creating Assembly