TaoK/PoorMansTSqlFormatter — Issue #35: Optional breaking before first option in a WITH clause
Author: TaoK
Created: 2012-01-13 11:53:18+00:00
State: open
Labels: priority-low

Here's an example:

RESTORE DATABASE dbname
FROM DISK = 'path\to\data\logicalfilename' WITH move 'databasename_Data' TO 'path\to\destination\filename.mdf'
,move 'databasename_Log' TO 'path\to\destination\filename_log.ldf'

That's the current formatted version. I think it's more readable to make it like this:

RESTORE DATABASE dbname
FROM DISK = 'path\to\data\logicalfilename' WITH
move 'databasename_Data' TO 'path\to\destination\filename.mdf'
,move 'databasename_Log' TO 'path\to\destination\filename_log.ldf'

OR

RESTORE DATABASE dbname
FROM DISK = 'path\to\data\logicalfilename'
WITH move 'databasename_Data' TO 'path\to\destination\filename.mdf'
,move 'databasename_Log' TO 'path\to\destination\filename_log.ldf'