Page 1 of 1
Formatting options, or bug?
Posted: Wed 18 May 2011 14:01
by dazzieb
How do I setup my formatting options to change
Code: Select all
BEGIN
SELECT *
FROM a
BEGIN
SELECT *
FROM b
END
END
To
Code: Select all
BEGIN
SELECT *
FROM a
BEGIN
SELECT *
FROM b
END
END
I am using the latest version.
TIA
Darren
Posted: Thu 19 May 2011 06:46
by .jp
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.