本文介绍了如何在 SQL Server 中将自定义字符串转换为日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!
问题描述
如何在 SQL Server 2012 中将 yyyyMMddhh
(2017092018
) 字符串转换为 Date
?
How to convert yyyyMMddhh
(2017092018
) string to Date
in SQL Server 2012?
是否可以不使用T-SQL将句子放入INSERT
子句中?
Is it possible to do without using T-SQL to put the sentence into the INSERT
clause?
推荐答案
示例
退货
如果是 2012+,我会建议 try_convert() 以防万一你有一些意外的值.
If 2012+, I would suggest try_convert() just in case you have some unexpected values.
这篇关于如何在 SQL Server 中将自定义字符串转换为日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!
本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!