How to: Deploy SQL Server Project Items to a SQL Server

After you build a SQL Server project, it is compiled into an assembly that can then be deployed to the database.


The common language runtime (CLR) integration feature is turned off by default in Microsoft SQL Server and must be enabled in order to use SQL Server project items. To enable CLR integration, use the clr enabled option of the sp_configure stored procedure. For more information, see Enabling CLR Integration.


As an alternative to building, deploying, and debugging in three separate steps, you can use the Start command (F5) to build the assembly, deploy it to the database, and debug the database object. Select the Start Without Debugging command (CTRL+F5) to build the assembly and deploy it to the database.

To deploy items in a SQL Server project to a SQL Server

  1. Build the project by selecting Build <project name> from the Build menu.


    Resolve all build errors prior to deploying.

  2. Select Deploy <project name> from the Build menu.


    If you receive a message informing you that the project cannot be deployed, then you may need to manually create the assembly on the server. This error is typically the result of referenced assemblies in your project. For more information on manually deploying your assembly, see the Create Assembly page in the "SQL Server Books Online."

After deploying SQL Server project items to the database, you will likely want to run the item to test it.

To test a deployed database item

Community Additions