| |

VerySource

 Forgot password?
 Register
Search
View: 669|Reply: 2

Who knows how to enable the "clr enabled" configuration option ?? Please advise !!!

[Copy link]

1

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-2-10 15:30:01
| Show all posts |Read mode
The error message is as follows:

A SELECT statement has been generated.
    Disable execution of user code in .Net Framewrok. Enable "clr enabled" configuration option


The above error message occurred when I was doing Asp.Net.

xsd TableAdapter


Solve?
Reply

Use magic Report

1

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

 Author| Post time: 2020-8-12 15:00:01
| Show all posts
I will publish the answer myself:

      
        //Execute this code in Sql Server to open CLR
        exec sp_configure'show advanced options', '1';
        go
        reconfigure;
        go
        exec sp_configure'clr enabled', '1'
        go
        reconfigure;
        exec sp_configure'show advanced options', '1';
        go
     

Execute this code in sql server
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-9-5 23:15:01
| Show all posts
Solution:

The following code is executed in the query analysis:

exec sp_configure'show advanced options', '1';
go
reconfigure;
go
exec sp_configure'clr enabled', '1'
go
reconfigure;
exec sp_configure'show advanced options', '1';
go


To enable

"

The configuration option'show advanced options' has been changed from 0 to 1. Please run the RECONFIGURE statement to install.
The configuration option'clr enabled' has been changed from 0 to 1. Please run the RECONFIGURE statement to install.
The configuration option'show advanced options' has been changed from 1 to 1. Please run the RECONFIGURE statement to install.

"




Explanation:

sp_configure [[@configname =]'option_name'
      [, [@configvalue =]'value']]



Remarks
Use sp_configure to display or change server-level settings. To change database level settings, use ALTER DATABASE. To change settings that only affect the current user session, use the SET statement.

Update running configuration values
When you specify a new value for the option, the value will be displayed in the config_value column of the result set. This value is initially different from the value in the run_value column, which shows the current running configuration value. To update the run configuration value in the run_value column, the system administrator must run RECONFIGURE or RECONFIGURE WITH OVERRIDE.

RECONFIGURE and RECONFIGURE WITH OVERRIDE are valid for each configuration option. However, the basic RECONFIGURE statement rejects any option values ​​that are outside of a reasonable range or that might cause option conflicts. For example, if the value of recovery interval is greater than 60 minutes, or the value of affinity mask and the value of affinity I/O mask overlap, RECONFIGURE generates an error. In contrast, RECONFIGURE WITH OVERRIDE accepts any option value with the correct data type and uses the specified value to force a reconfiguration.

Some configuration options (such as affinity mask and recovery interval) are designated as advanced options. By default, these options cannot be viewed and changed. To make these options available, set the Show Advanced Options configuration option to 1.

Use the clr enabled option to specify whether Microsoft SQL Server can run user assemblies. The clr enabled option provides the following values.

Value Description
0
It is not allowed to execute assemblies on SQL Server.

1
Allows the execution of assemblies on SQL Server.



The clr enabled option is an advanced option. If you use the sp_configure system stored procedure to change this setting, you can only change clr enabled when show advanced options is set to 1. This setting takes effect immediately after running sp_configure. There is no need to restart the SQL Server instance.

Note:
When running RECONFIGURE, the operating value of the clr enabled option will be changed from 1 to 0, and all application domains containing user assemblies will be uninstalled immediately.
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list