SQL Clone Instance Creation

sdudzicsdudzic Posts: 2 New member
I am cloning a database which has CLR functionality and I want to run the following commands when creating the image:
sp_configure 'show advanced options', 1;  
GO  
RECONFIGURE;  
GO  
sp_configure 'clr enabled', 1;  
GO  
RECONFIGURE;  
GO  

This does not work when applied as a SQL modification script when creating the image.  The error is:
"An exception was thrown while executing a script: System.Data.SqlClient.SqlError: User does not have permission to perform this action."

I have confirmed that the user accessing the database has sysadmin permissions and other data manipulation activities work fine (it just fails when trying to do the reconfigure statement).

Other notes:  I am creating the image from a database backup.  Creating through the UI will fail and then I have access to the error message.  Howerver, when running on Powershell, the process completes and the failure in the modification script does so silently and still creates the image. 

How can I run statements such as the above that require Reconfigure?
Tagged:

Answers

Sign In or Register to comment.