Using TRY_CONVERT in SQL Server 2012

Using TRY_CONVERT in SQL Server 2012

Using TRY_CONVERT  in SQL Server 2012

TRY_CONVERT returns the value as the specified data_type; if an error occurs, null is returned. However if you request a conversion that is explicitly not permitted, then TRY_CONVERT fails with an error.

TRY_CONVERT conversion function is supported in SQL Server 2012, but it is not supported in Windows Azure SQL Database so you have to use TRY_CAST in Windows Azure SQL Database.

In Windows Azure SQL Database so you have to use TRY_CAST in place of TRY_CONVERT.

As TRY_CAST is same as  TRY_CONVERT, as CAST is analogous to CONVERT, but CONVERT's expression and style arguments are different.


See Also


Leave a Comment
  • Please add 2 and 3 and type the answer here:
  • Post
Wiki - Revision Comment List(Revision Comment)
Sort by: Published Date | Most Recent | Most Useful
Comments
  • Richard Mueller edited Original. Comment: Fixed tag "SQL Server 2012", added language tag

Page 1 of 1 (1 items)
Wikis - Comment List
Sort by: Published Date | Most Recent | Most Useful
Posting comments is temporarily disabled until 10:00am PST on Saturday, December 14th. Thank you for your patience.
Comments
  • Richard Mueller edited Original. Comment: Fixed tag "SQL Server 2012", added language tag

Page 1 of 1 (1 items)