?????: ????? ??? ????? ??? ????? ??????? ?????? ??????? TRY_CONVERT ?? ????? ????? ?? SQL Server 2012

?????? ????????? ?????? ?????????
???? ???????: 2778494 - ??? ???????? ???? ????? ????? ??? ???????.
???? Microsoft ?????? ????????? Microsoft SQL Server 2012 Service Pack 1 ???? ???? ???????. ??? ????????? ???????? ????? ?? ????? ???? ???? ????????? ??????? ?????? ????? ???? ??????? ?????? ???? ?? ??????? ?? ??????? SQL Server 2012 Service Pack 1.
????? ???? | ?? ????

?? ??? ??????

???????

????? ?? ???? ?????? ??????? ???? ?????? ??????? TRY_CONVERT ?? ????? ????? ?? Microsoft SQL Server 2012. ?? ??? ??????? ?? ??? ????? ??????? ????? ??? ????????? ?????? ????? ??? ?????.

????

??????? ??????? ????????

??????? ???????? 2 ? SQL Server 2012 SP1

?? ????? ??????? ????? ???? ??????? ????? ?? ??????? ???????? 2. ????? ?? ????????? ??? ????? ?????? ??? ???? ??????? ???????? ? SQL Server 2012 SP1? ???? ??? ??? ??????? ?????? ?????? ?? "????? ??????? ? Microsoft":
2790947 ???? ??????? ???????? 2 ????? ?????? service Pack 1 ?????? ? SQL Server 2012
?????? ??? ??????? ???????? ????? ?? ????? ????? ???? ???? ????????? ??????? ?????? ????? ???? ??????? ?????? ???? ?? ??????? ?? SP1 2012 ???? SQL ???????. ???? ??????? ????? ???? ????? ??????? ???? ????? ??? ??? ??????? ??????. ????? ?? ?????????? ???? ??? ??? ??????? ?????? ?????? ?? "????? ????? Microsoft":
2772858 ???? 2012 ???? SQL ???? ?? ??????? ??? ????? ???? ?????? service Pack 1 ?????? ? SQL Server 2012

?????

???? Microsoft ?? ??? ?? ????? ?? ?????? Microsoft ??????? ?? ??? "????? ???".

??????? ????

?????? ????? ??? ???????? ???? ??? ???????:
  1. ????? ???? ?? SQL Server 2012 SP1 ?????? "??????"? ?????? ??? ?? ??????:
    CREATE TABLE TEST (I DATE);
    
    INSERT INTO TEST VALUES (GETDATE());

  2. ????? ??????????? ??????? ?????? ????? ?????:

    SELECT TOP 1 TRY_CONVERT(VARCHAR, TRY_CONVERT(DATE, '20121023'), 112) FROM TEST;
    
    SELECT CONVERT(VARCHAR, TRY_CONVERT(DATE, '20121023'), 112) FROM TEST;
    
    SELECT CONVERT(VARCHAR, CONVERT(DATE, '20121023'), 112) FROM TEST;
    
    SELECT TRY_CONVERT(VARCHAR, '20121023', 112) FROM TEST;
    
    --The returned result is "20121023".
  3. ?? ?? ?????? ??????????? ??????? ?????? ????? ??? ?????:

    SELECT TRY_CONVERT(VARCHAR, TRY_CONVERT(DATE, '20121023'), 112) FROM TEST;
    
    SELECT TRY_CONVERT(VARCHAR, CONVERT(DATE, '20121023'), 112) FROM TEST;
    
    --The returned result is "2012-10-23".
    
    

?????

?????? ??? ???? ?? ????????? ??? ???? TRY_CONVERT(Transact-SQL)? ????? ??? ???? ??? MSDN ??????:
??????? ???? ??? ???? TRY_CONVERT(Transact-SQL)

?????? ??? ???? ?? ????????? ??? "????? ????? ??????" ? SQL Server? ???? ??? ??? ??????? ?????? ?????? ?? "????? ??????? ? Microsoft":
935897 ????? "????? ????? ??????" ?? ???? SQL Server ?????? ????????? ??????? ??????? ?? ??????? ????
?????? ??? ???? ?? ????????? ??? ???? ??????? ???????? SQL Server? ???? ??? ??? ??????? ?????? ?????? ?? "????? ??????? ? Microsoft":
822499 ???? ??????? ???? ??????? ????? Microsoft SQL Server
????? ?? ????????? ??? ??????? ????? ???????? ???? ??? ??? ??????? ?????? ???? ??????? ?? ????? ????? Microsoft:
824684 ??? ????????? ???????? ????????? ?? ??? ??????? ????? Microsoft

???????

???? ???????: 2778494 - ????? ??? ??????: 12/???? ?????/1434 - ??????: 1.0
????? ???
  • Microsoft SQL Server 2012 Service Pack 1
  • Microsoft SQL Server 2012 Enterprise
  • Microsoft SQL Server 2012 Developer
  • Microsoft SQL Server 2012 Standard
  • Microsoft SQL Server 2012 Web
  • Microsoft SQL Server 2012 Express
????? ??????: 
kbqfe kbfix kbsurveynew kbexpertiseadvanced kbmt KB2778494 KbMtar
????? ????
???: ??? ????? ??? ?????? ???????? ?????? ????? ???? ????? ?????????? ????? ?? ????????? ?????? ????. ???? ???? ?????????? ???? ?? ???????? ???????? ?????? ????????? ????? ????????? ???????? ????? ???????? ?????? ?? ?????? ??? ?? ???????? ???????? ?? ????? ??????? ?????? ??? ??????? ?????? ??. ?????? ?? ???? ??? ??????? ???????? ????? ?? ???? ????? ?????? ??? ????? ??? ????? ??????? ?? ????? ?? ?????? ??? ??? ??????? ??????? ?? ????? ????? ????? ????? ?????. ?? ????? ???? ?????????? ??????? ??? ????? ?? ??????? ?? ????? ?????? ?? ??? ????? ?? ????? ??????? ?? ???????? ?? ??? ???????. ???? ???? ?????????? ???????? ??? ????? ?????? ??????? ??????
???? ??? ????? ??????? ?????? ??????????2778494

????? ???????

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com