Batch run for Layout?

sgiasgia Posts: 4
edited February 17, 2009 8:26AM in SQL Prompt Previous Versions
Hello, can anyone tell me if it is possible to BATCH run the SQL layout command? I have a bunch (several hundred) stored procedures I would like to clean up and a batch function would be great.

Thanks,
SG

Comments

  • That would indeed be awesome.

    Using a file open interface, to just point SQL Prompt at a folder full of SQL scripts and have them formatted and saved back again would be brilliant.

    Senior DBA
    Careers South West Ltd
  • Thanks for the request. I take it you're both looking for something slightly different? Sgia, you want to modify the layout of all your database's stored procedures and Fatherjack you'd like to modify a set of SQL scripts in a specified folder?

    David Atkinson
    Product Manager
    Red Gate Software
    David Atkinson
    Product Manager
    Redgate Software
  • Thanks for the request. I take it you're both looking for something slightly different? Sgia, you want to modify the layout of all your database's stored procedures and Fatherjack you'd like to modify a set of SQL scripts in a specified folder?

    David Atkinson
    Product Manager
    Red Gate Software

    Yes, I would like to have the CTRL-SHIFT-Y functionality applied to all stored procedures in a database.
  • I found that I can do a "Generate SQL scripts" from Enterprise manager (select all the SPs, right click, All Tasks, Generate SQL Script) -
    let it create the DROP and CREATE scripts for ALL the SPs, then copy the resulting script to Query Analyzer and run LayOut SQL over that.

    Worked like a charm.

    SG
  • meklemblmeklembl Posts: 107 Bronze 2
    Don't forget to change the CREATE statements to ALTER otherwise any permissions that were granted may be lost.

    For some reason, permissions are not generated in the script.

    Regards,
    Larry M
    Cleveland, OH USA
Sign In or Register to comment.