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
sgia
0

Comments

5 comments

  • fatherjack2
    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.
    fatherjack2
    0
  • David Atkinson
    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
    0
  • sgia
    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.
    sgia
    0
  • sgia
    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
    sgia
    0
  • meklembl
    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,
    meklembl
    0

Add comment

Please sign in to leave a comment.