sql server 2012中的转换函数有什么区别 [英] what is difference between the conversion function in sql server 2012

查看:79
本文介绍了sql server 2012中的转换函数有什么区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

sql server 2012中下面的转换函数有什么区别?

1).Cast

2)。转换

3)。解析

4).Try_Cast

5).Try_Convert

6)。try_Parse。

what is difference between below conversion function in sql server 2012?
1).Cast
2).Convert
3).Parse
4).Try_Cast
5).Try_Convert
6).Try_Parse.

推荐答案





这里有一篇不错的博文:

http://www.geniiius.com/blog/sql-server-2012-new-conversion-functions [ ^ ]


CAST和CONVERT(Transact-SQL)



SQL Server 2012其他版本66(共102个)对此评分有用 - 评价此主题

在SQL Server 2012中将一种数据类型的表达式转换为另一种数据类型。



PARSE(Transact-SQL)



SQL Server 2012 17/26对此评分有用 - 评价此主题

返回表达式的结果,转换为SQL Server 2012中请求的数据类型。



TRY_CONVERT(Transact-SQL)



SQL Server 2012 8的评分对此评分很有用 - 评价此主题

如果转换成功,则返回强制转换为指定数据类型的值;否则,返回null。





TRY_CAST(Transact-SQL)



SQL Server 2012 2的评分为2分非常有用 - 评价此主题

如果转换成功,则返回强制转换为指定数据类型的值;否则,返回null。



TRY_PARSE(Transact-SQL)



SQL Server 2012 2/5评分为此帮助 - 评价此主题

返回表达式的结果,转换为请求的数据类型,如果在SQL Server 2012中转换失败,则返回null。仅使用TRY_PARSE将字符串转换为日期/时间和数字类型。
CAST and CONVERT (Transact-SQL)

SQL Server 2012 Other Versions 66 out of 102 rated this helpful - Rate this topic
Converts an expression of one data type to another in SQL Server 2012.

PARSE (Transact-SQL)

SQL Server 2012 17 out of 26 rated this helpful - Rate this topic
Returns the result of an expression, translated to the requested data type in SQL Server 2012.

TRY_CONVERT (Transact-SQL)

SQL Server 2012 8 out of 10 rated this helpful - Rate this topic
Returns a value cast to the specified data type if the cast succeeds; otherwise, returns null.


TRY_CAST (Transact-SQL)

SQL Server 2012 2 out of 2 rated this helpful - Rate this topic
Returns a value cast to the specified data type if the cast succeeds; otherwise, returns null.

TRY_PARSE (Transact-SQL)

SQL Server 2012 2 out of 5 rated this helpful - Rate this topic
Returns the result of an expression, translated to the requested data type, or null if the cast fails in SQL Server 2012. Use TRY_PARSE only for converting from string to date/time and number types.


这篇关于sql server 2012中的转换函数有什么区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆