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

???? ?????? ???? ??????
???? ID: 2778494 - ?? ???????? ?? ?????? ??? ?? ?? ???? ???? ???? ??.
Microsoft Microsoft SQL Server 2012 ?????? ??? 1 ?????? ?? ??? ??? ?? ??????? ???? ????? ????? ?????? ???? ??? ??????? ??????? ????? ???? ???, ????? ??? ?????????? ?? ?? ???? ?? ?? ?? ????? SQL Server 2012 ?????? ??? 1 ??? ????? ??? ?? ??? ??????? ???????? ?????? ????
??? ?? ??????? ???? | ??? ?? ??????? ????

?? ????? ??

?????

??? ??? ?? ?? Microsoft SQL Server 2012 ??? ???? ???????? ?? ??? TRY_CONVERT ??????? ?? ????? ???? ?? ?? ?????? ?????? ?? ?????? ???, ?? ???? ???????? ?? ????? ???? ???? ?? ???? ?? ?? ?????? ???? ??? ?????? ?? ???? ???

????????

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

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

?? ?????? ?? ??? ????? ???? ????? ?????? 2 ??? ?????? ???? ??? ??? ?? ????? ?????? ?????? ?? SQL Server 2012 SP1 ?? ??? ??????? ???? ?? ????? ?? ???? ??? ???? ??????? ?? ??? Microsoft ?????? ??? ??? ???? ????? ?? ??? ????? ???? ?????? ?? ????? ????:
2790947 SQL Server 2012 ?????? ??? 1 ?? ??? ????? ?????? ?????? 2
??? Builds ????? ???? ???, ??????? ??? ?????????? ?? ?? ????? ???? ?? ?? ?? ????? SQL Server 2012 SP1 ?? ??? ????? ??? ?? ??? ??????? ???????? ?????? ??? ????? ?? ???? ???? ?????? ?? ???????? ????? ?????? ????? ?????? ????? ?? ????? ??? ???? ??????? ?? ??? Microsoft ?????? ??? ??? ???? ????? ?? ??? ????? ???? ?????? ?? ????? ????:
2772858 SQL Server 2012 SQL Server 2012 ?????? ??? 1 ?????? ???? ??? ?? ?? ??? ?????? ??? ?? ?? ????? ??

??????

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 ????? ?? ??? Microsoft ?????? ??? ??? ???? ????? ?? ??? ????? ???? ?????? ????? ????:
935897 ?? ????????? ????? ???? ?????????? ??????? ?? ?? ???????? ?? ??? ?????? ???? ?? ??? SQL Server ??? ?? ?????? ???? ??
SQL ????? ?????? ?? ??? ?????? ?????? ?? ???? ??? ???? ??????? ?? ??? Microsoft ?????? ??? ??? ???? ????? ?? ??? ????? ???? ?????? ?? ????? ????:
822499 Microsoft SQL ????? ?????????? ?????? ???????? ?? ??? ?????? ??????
?????????? ?????? ?????? ?? ???? ??? ???? ??????? ?? ??? Microsoft ?????? ??? ??? ???? ????? ?? ??? ????? ???? ?????? ?? ????? ????:
824684 Microsoft ?????????? ???????? ?? ????? ???? ??? ???????? ???? ???? ???? ?????? ?? ?????

???

???? ID: 2778494 - ????? ???????: 24 ????? 2013 - ??????: 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 KbMthi
???? ?????? ????????
??????????: ?? ???? ?? ???? ??????? ?? ????? ?? Microsoft ????-?????? ?????????? ?????? ?????? ???? ??? ??. Microsoft ???? ??? ????-???????? ?? ????-???????? ????? ?????? ?? ???? ???????? ???? ?? ???? ????? ????? ??? ?? ??? ?????? ?? ???? ???? ???? ??? ????? ??. ???????, ????-???????? ???? ????? ???? ???? ???? ???. ?????, ????????, ?????-???? ?? ??????? ?? ???????? ?? ???? ???, ???? ?? ??? ?????? ???? ???? ??? ????? ??? ?? ???? ??. Microsoft ??????? ??? ???? ?? ?????? ?? ??????????, ????????? ?? ??? ?????? ?? ???? ????? ?? ???? ???????? ?? ??? ???? ????? ?? ??? ????????? ???? ??. Microsoft ????-?????? ?????????? ?? ????? ?????? ?? ?? ??? ??.
?????????? ?? ??????? ????????? ??????? ??: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