Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8435487
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T06:55:43+00:00 2026-06-10T06:55:43+00:00

I got CONFIG statement cannot be used inside a user transaction when running procedure

  • 0

I got

CONFIG statement cannot be used inside a user transaction

when running procedure 2 below. Any resolution? Thanks.

Procedure #1:

CREATE PROC [dbo].[nz_test1]
as
   EXEC sp_configure 'show advanced option', 1
   RECONFIGURE WITH OVERRIDE
   EXEC sp_configure 'xp_cmdshell', 1
   EXEC sp_configure 'ad hoc distributed queries', 1  
   RECONFIGURE WITH OVERRIDE

select 1

Procedure #2:

create proc [dbo].[test_nz_tb3]
as
    create table #t (a varchar(2))

    insert into #t
           exec nz_test1
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T06:55:44+00:00Added an answer on June 10, 2026 at 6:55 am

    Apparently (to me, anyway), if you are told that you can’t do what you are trying to do, you need to change your code to avoid doing what you aren’t allowed to. In particular, you likely need to move the configuration/reconfiguration code outside the procedure you are calling in the INSERT statement (the nz_test1 one), to another stored procedure, for instance. Run that code separately, probably before the insert (that may depend on what you are trying to achieve with that reconfiguration, which you aren’t revealing).

    So, something like this, perhaps:

    CREATE PROCEDURE dbo.my_config
    AS
        EXEC sp_configure 'show advanced option', 1;
        RECONFIGURE WITH OVERRIDE;
        EXEC sp_configure 'xp_cmdshell', 1;
        EXEC sp_configure 'ad hoc distributed queries', 1;
        RECONFIGURE WITH OVERRIDE;
    GO
    CREATE PROCEDURE dbo.nz_test1
    AS
        SELECT 1 AS Value;
    GO
    CREATE PROCEDURE dbo.test_nz_tb3
    AS
        EXEC dbo.my_config;
        CREATE TABLE #t (a varchar(10));
        INSERT INTO #t
            EXEC dbo.nz_test1;
    

    Make sure you do not call test_nz_tb3 within a transaction either. Otherwise you’ll need to call my_config outside test_nz_tb3, likely before the transaction where the latter is called.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got 3 connectionstrings in web.config, and I used theirs like this: using (SqlConnection
I've got a webapp running on CherryPy that needs to access the CherryPy config
I've got the following I've pasted into my user model: module ClassMethods Devise::Models.config(self, :email_regexp,
I've got this in my web.config and it's being hosted by the DiscountASP.net ISP
I've got customErrors set in my web.config <customErrors mode=On defaultRedirect=/Error/GeneralError> <error statusCode=404 redirect=/Error/NotFound/> </customErrors>
I've got multiple membership providers in my web.config and in my login control, I
I got this PHP code: // connect to mysql require_once('includes/connect.php'); // include config include('includes/config.php');
I've got some questions about two ways to save settings in the web.config. Appsettings
ok i got this problem. i have this routes: (code bit change) File:/home/dotcloud/current/config/routes.js exports.routes
Hey! I've got a generic package that requires a config file and multiple packages

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.