Error deploying SQL project with Visual Studio 2008

When you deploy an SQL project with Visual Studio 2008, we create a .sql file.

In the project properties, we set the deployment action: create a deployment script. When you create and deploy a project .sql is generated as expected. When checking the generated code, I see the following SQL code:

CREATE ASSEMBLY [System.Core] AUTHORIZATION [dbo] FROM 0x4D5A9 .... WITH PERMISSION_SET = SAFE;

Executing this part of the code will result in the following error.

CREATE ASSEMBLY failed because the System.Core assembly is a system assembly. Consider creating a custom assembly to wrap your desired functionality.

Why is this code generated first and how can I prevent this code from being generated? (As far as I know, we do not have any SQLCLR or LINQ stored procedures in the project)

+4
source share
1 answer

I'm not sure about VS2008, but in VS2012, the "Database Project Properties" tab has a SQLCLR tab. One option at the bottom of the page is the Generate DDL check box. If this is checked, clear the check box, then re-create and generate the script.

Third paragraph of How to work with CLR database objects :

The CLR and CLR Build property pages contain many settings for using the CLR database objects in your project. In particular, the CLR page property has a permission level setting for setting permissions for the CLR assembly. It also has the Create DDL option to control whether DDL is generated for CLR database objects added to the project. The CLR Build properties page contains all the compiler options that you can configure to configure the compilation of CLR code in the project. These property pages can be accessed by right-clicking your project in Solution Explorer and selecting "Properties"

For more information about SQLCLR parameters in database project properties, see the MSDN article: http://msdn.microsoft.com/en-us/library/hh272681(v=vs .103) .aspx # bkmk_sqlclr_sqlclrbuild

+2
source

Source: https://habr.com/ru/post/1479361/


All Articles