問題描述
我們公司使用一個舊的應用程序,它從一個 .INI 文件中讀取 TSQL.由于應用程序處理 INI 文件的方式,TSQL 必須全部在一行上.我使用Poor Mans TSQL Formatter 使SP 之類的所有東西都變得漂亮整潔,但我想知道是否有什么可以做相反的事情-采用格式良好的TSQL 并將其全部推到一行上(刪除回車、換行等).我正在使用 SSMS,但也使用 Notepad++,如果其他編輯器具有該功能,我會很樂意使用它.
Our company uses an old app which reads TSQL from a .INI file. Due to how the app process the INI file the TSQL has to be all on one line. I use Poor Mans TSQL Formatter to get everything nice and tidy for things like SPs, but am wondering if there's something out there to do the reverse - take nicely formatted TSQL and shove it all onto one line (removing carriage returns , line breaks etc). I'm working in SSMS but also use Notepad++, and will happily use some other editor if it has the functionality.
推薦答案
使用 Notepad++
Using Notepad++
選擇多行的語句,然后在菜單上:TextFX>TextFX Edit>Unwrap Text
Select the statement that is over multiple lines then on the menu: TextFX>TextFX Edit>Unwrap Text
為了更輕松,您可以使用快捷方式映射器(設置>快捷方式映射器)將其分配給鍵盤快捷方式
And for even greater ease you can assign it to a keyboard shortcut using the shortcut mapper (Settings>Shortcut Mapper)
這篇關于將 TSQL 格式化為一行的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!