locked
Extra blank lines when modifying a view in SSMS RRS feed

  • Question

  • I'm using SQL Server 2012 and SSMS 11.0.6251.0 on Windows 7.

    I noticed this problem a few years back. It's not a huge deal and it doesn't affect how anything runs but it definitely gets annoying.

    It happens with views when you right click and select Script View as -> Alter To -> New Query Editor Window. I'm wondering if there's a solution. Blank lines are added every time you open up a view or function for modification. If you don't take them out, it adds more the next time around. Why in the world would it do that? Is it a bug? If it is, has it been fixed in later versions? If it's intentional, why? What's the benefit????

    In the first screenshot, I saved the view without blank lines. The second screenshot is after opening it and saving ("alter view") it without making any changes at all a few times in a row. It also adds blank lines at the bottom of the view code.

    Like I said, it's not a big deal. Just a bit annoying and I'm wondering if there's a way to make it stop doing that. I've looked over all the scripting settings and can't find anything that would seem to solve this.

    Tuesday, February 27, 2018 2:39 PM

Answers

  • Hi keithrh,

    >> Why in the world would it do that? Is it a bug? If it is, has it been fixed in later versions? If it's intentional, why? What's the benefit????

    I tested on my machine with SQL Server 2012, SSMS 11.0.7001.0 and SQL Server 2016, SSMS 14.0.17224.0 (latest version), blank lines do exist. See screenshots below:

    Regarding this issue, I would suggest you submit it at this site. This site will serve as a connecting point between you and Microsoft, and ultimately the large community for you and Microsoft to interact with. Your feedback enables Microsoft to offer the best software and deliver superior services, meanwhile you can learn more about and contribute to the exciting projects on this website.

    If you have any other questions, please let me know.

    Regards,

    Hannah


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, February 28, 2018 1:56 AM
    Answerer

All replies

  • Hi keithrh,

    >> Why in the world would it do that? Is it a bug? If it is, has it been fixed in later versions? If it's intentional, why? What's the benefit????

    I tested on my machine with SQL Server 2012, SSMS 11.0.7001.0 and SQL Server 2016, SSMS 14.0.17224.0 (latest version), blank lines do exist. See screenshots below:

    Regarding this issue, I would suggest you submit it at this site. This site will serve as a connecting point between you and Microsoft, and ultimately the large community for you and Microsoft to interact with. Your feedback enables Microsoft to offer the best software and deliver superior services, meanwhile you can learn more about and contribute to the exciting projects on this website.

    If you have any other questions, please let me know.

    Regards,

    Hannah


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, February 28, 2018 1:56 AM
    Answerer
  • This is not resolved. I've had this issue on many different versions of SQL management studio 2008, 2012 all the way to 2017 on various version of SQL Server. If this issue has been raised elsewhere please can anyone point me to the post. To the OP, i agree this can get really annoying and no bro your not the only one who's had to deal with this extra spaces being added when saved issue, very annoying when trying to keep code tidy.

    Simply alter a store procedure, hit F5, close procedure and repeat. Extra spaces added to top and bottom.



    • Edited by laffo16 Monday, July 27, 2020 12:40 PM
    Monday, July 27, 2020 12:38 PM