Click or drag to resize
SqlHelperEnsureMissingColumns Method
Ensures the missing columns in the given collection of QueryColumnList instances and removes all occurrences of all columns selector in them

Namespace: CMS.DataEngine
Assembly: CMS.DataEngine (in CMS.DataEngine.dll) Version: 11.0.0
Syntax
C#
public static void EnsureMissingColumns(
	ICollection<QueryColumnList> columnLists
)

Parameters

columnLists
Type: System.Collections.GenericICollectionQueryColumnList
Input lists of columns
Remarks
This method is useful when doing e.g. UNION on two queries and the same columns are needed in both queries.
Examples

Collection A has { A, B as C, D } and collection B has { X, D, C } after calling this method result is A has { A, B as C, D, NULL AS X } and B has { X, D, C, NULL AS A }.

Another example, collection A has { *, A } and B has { X } result is A has { A , NULL as X } and B has { X, NULL as A }.

See Also