If you have dbForge SQL Complete Standard or Trial Edition, it's enough to turn the Place clause content on new line option (Options->Formatting->New Lines) off to get the kind of formatting you need. In this case formatting will be like the following:
Code: Select all
BEGIN
SELECT *
FROM a
BEGIN
SELECT *
FROM b
END
END
Also please pay attention to the fact that if you want to have two spaces before the select statement, you should set Tab size, Indent size - 2, Insert spaces – check in the MSSMS, Tools->Options->Text Editor->Transact-SQL->Tabs options.
If you have Express Edition, I should say that it supports only formatting of select, update, insert, delete statements. It means that Begin...end blocks will not be formatted, and the select statement will be formatted accordingly to your settings.