TRY_CAST (Azure Stream Analytics)

 

Published: March 4, 2016

Updated: April 22, 2016

Applies To: Azure

Returns a value cast to the specified data type if the cast succeeds; otherwise, returns null.

Syntax

TRY_CAST ( expression AS data_type)  
  

expression

The value to be cast. Any valid expression.

data_type

The data type into which to cast expression. Is the target data type supported by Stream Analytics Query Language.

Returns a value cast to the specified data type if the cast succeeds; otherwise, returns null.

SELECT TollId, EntryTime   
FROM Input  
WHERE TRY_CAST( EntryTime AS datetime) IS NOT NULL  

Show: