Understanding the CAST Function in MS SQL Server