有没有办法在sql脚本文件中创建可折叠区域,就像我们在VS中创建的那样
#region ….. #endregion?
#region ….. #endregion?
– 编辑 –
脚本文件包含像Alter Table和Alter View等DDL语句,我想将它们分组到像“表相关语句”“查看相关语句”等区域.
解决方法
是的,有
SSMS Tools Pack
@H_403_13@Regions and Debug sections
Regions behave in the same way as in Visual Studio. You can collapse them and expand them. Debug sections are sections that get commented when you change your script to Release configuration. A debug section is also a collapsable region. If you deploy a script in debug mode with added debug sections it will fail when run from SSMS without SSMS Tools Pack installed. You can of course comment those sections yourself by simply searching for start and end text of the debug sections