Is it possible to add the reverse feature of inline exec?

ogrishmanogrishman Posts: 81 Bronze 4
edited November 28, 2016 4:16AM in SQL Prompt
It's great you guys added the "inline exec" feature in the most recent build. Its reverse feature sometimes is useful too. Is it possible to add "inline exec"'s reverse feature?

Thanks and happy Thanksgiving!

Comments

  • Hi ogrishman,

    So there may be a feature that does what you mean. If you select some SQL and press the Ctrl key to open up the actions list, you can find Encapsulate as stored procedure:

    MQUCDtX.png

    Then you get a script like this:

    V9qe40g.png

    Is this the kind of thing you're looking for?

    Best regards,

    David
  • ogrishmanogrishman Posts: 81 Bronze 4
    No David, that's not what I want. Basically "inline execute" converts something like
    DECLARE @input INT = 10;
    DECLARE @output INT;
    
    EXEC sys.sp_executesql
        N'SELECT @output = @input',
        N'@input INT, @output INT out',
        @input = @input,
        @output = @output OUT;
    

    To
    DECLARE @input1 INT;
    SET @input1 = @input;
    SELECT @output = @input1
    

    What I want is a feature to wrap a piece of code in sp_executesql.

    Thanks and happy Thanksgiving!
  • Hi ogrishman,

    I see where you're coming from.

    At the moment we don't have this functionality. Would you be able to add it as a feature suggestion on our UserVoice page?

    Best regards,

    David
Sign In or Register to comment.