SQL Prompt Pro - Is it possible to apply a format style to multiple files at once?

  • Currently trialing SQL Prompt Pro 9 in Visual Studio 2017.

    Anyone know if there is a way to apply the chosen style across a whole SSDT project rather than just one file at a time?
    I'd like to do this as a once off starting point for some legacy code as a single git commit.

    Maybe there is a command line for the formatter which I could code up in some powershell to walk the folder structure or something?

    I couldn't find a native way in the menus to apply a style to anything other than the current file.

  • There is a UserVoice feature request for this functionality - go vote it up!

    Thomas Rushton
    blog: https://thelonedba.wordpress.com

  • ThomasRushton - Friday, November 24, 2017 3:50 AM

    There is a UserVoice feature request for this functionality - go vote it up!

    Done!

    Although that request is 2.5 yrs old now and it still hasn't happened, and only has 20 votes. Disappointing.
    I assumed such a feature would exist.

    Maybe I could write a visual studio addin that opens every sql file in a project and SendKeys to format it, then save it.
    Seems silly, but I don't want to do all of this manually! (thousands of files across multiple projects)

  • KevinCust - Friday, November 24, 2017 1:21 PM

    ThomasRushton - Friday, November 24, 2017 3:50 AM

    There is a UserVoice feature request for this functionality - go vote it up!

    Done!

    Although that request is 2.5 yrs old now and it still hasn't happened, and only has 20 votes. Disappointing.
    I assumed such a feature would exist.

    Maybe I could write a visual studio addin that opens every sql file in a project and SendKeys to format it, then save it.
    Seems silly, but I don't want to do all of this manually! (thousands of files across multiple projects)

    I agree that it's a shame; however, consider what happens if you automate this and something breaks because (it has happened, albeit rarely) SQLPrompt itself can't handle something properly?

    The format completes; however, the code generated is unparseable/unexecutable/just plain wrong...

    Thomas Rushton
    blog: https://thelonedba.wordpress.com

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply