Word wrap column specification when longer than right margin, or when logical operators (NOT, AND, OR) are encountered
A column specification in a SELECT list can become very long, especially when a CASE statement is replaced by the new Iif function. The column specification will not wrap, even when its length is far beyond the right margin. E.g:
SELECT
Bom.BillOfMaterialsID,
Bom.ProductAssemblyID,
Bom.ComponentID,
CONVERT(bit, IIF((Bom.BillOfMaterialsID = Bom.ProductAssemblyID OR Bom.BillOfMaterialsID IS NULL AND Bom.ProductAssemblyID IS NULL) AND (Bom.ComponentID = Bom.ProductAssemblyID OR Bom.ComponentID IS NULL), 1, 0)) AS [Check]
FROM AdventureWorks2012.Production.BillOfMaterials AS Bom
The last column specification will always end up on a single line.