Coalescing (??) Operator for .Net

The Null-Coalescing Operator acts similiar to TSQL IsNull.

The ?? operator defines the default value to be returned when a nullable type is assgned to a non-nullable type. This works for both reference types and value types

C#.Net Example:
string message = strOldMessage ?? "This is the default";
TSQL Example:
IsNull(printDate, GetDate())

Comments

Popular posts from this blog

Cross Apply and Outer Apply

SSRS Issues attaching Reports to Email subscriptions

TSQL Max and Over Clause