Encapsulate as New Stored Procedure

Todd_RobinsonTodd_Robinson Posts: 6
edited November 27, 2006 4:45PM in SQL Refactor Previous Versions
When you use the Encapsulate as New Stored Procedure function, the script that it creates does not Lay Out SQL for you automatically. You must run the Lay Out SQL for it to modfy the script to format it per your options. Not sure if this is by design, but I would expect any scripts created by the Refactoring tool should use the options I specified.

Comments

  • When you use the Encapsulate as New Stored Procedure function, the script that it creates does not Lay Out SQL for you automatically. You must run the Lay Out SQL for it to modfy the script to format it per your options. Not sure if this is by design, but I would expect any scripts created by the Refactoring tool should use the options I specified.


    Hi Todd,

    this is by design. If someone does not want his new code indented, and would like to preserve its previous lay out when encapsulating it as a new stored procedure, then they can still use this feature. Similarly, in the case of table split, we rewrite all the dependent views, stored procedures, but do not reformat them. We also do not capitalize keywords by default. All the refactorings are like building blocks. They can be executed in sequence though, so if you let's say split a table, we generate a script, you may then uppercase the keywords, lay out the script that will affect all the referenced objects, and they will be nicely formatted, expand wildcards in views, qualify object names, and then search for unused variables and parameters. Adding all of these as an option to each of the refactorings is something we have decided against. However, all of the refactorings are accessible via shortcut keys (in the final version, which we will release in a few hours), and all the above operations can be performed by pressing just a few keys.

    Regards,
    Andras
    András Belokosztolszki, PhD
    Red Gate Software Ltd.
  • Andras,

    I think you are fighting a losing battle. I have seen many posts of users that want Refactor to layout the SQL when it does any other function (including myself).

    As a consumer the #1 reason I purchased the product was for layout. Everything else was just a extra that did not have much influence on my purchase decision. So to make me have to do it as 2 steps regardless of how simple is undermining the value and utility of the product to me. If someone asks me my opinion on Refactor what I will be telling them is it is a great product, but has a functional deficiency in that it is implemented as a toolkit and not as an integrated product.

    Tim
    Denver, CO
  • Hi Tim,

    clearly this is an important issue for you and it has not been ignored. I will add your current posts to the alredy existing issue our issue tracking deatabase and I will certainly consider this for inclusion again in the next release. Many thanks,

    Regards,
    Andras
    András Belokosztolszki, PhD
    Red Gate Software Ltd.
  • I know I'm late to the party but I'll chime in supporting Tim's POV. My shop if full of generalists who use Visual Studio as much as SQLMS, and based off of that experience my expectation would be that my preferences regarding formatting would be preserved, or at least have the option to always auto-format. Yes, I could use a shortcut key but this is extra work I shouldn't have to do. My $.02...
Sign In or Register to comment.