DetailPage-MSS-KB

Microsoft small business knowledge base

Article ID: 2778494 - Last Review: January 24, 2013 - Revision: 1.0

Microsoft distributes Microsoft SQL Server 2012 Service Pack 1 fixes as one downloadable file. Because the fixes are cumulative, each new release contains all the hotfixes and all the security fixes that were included with the previous SQL Server 2012 Service Pack 1 fix release.

On This Page

Symptoms

Assume that you run a query that uses the TRY_CONVERT function together with the style parameter in Microsoft SQL Server 2012. In this situation, the style parameter may be ignored and the query may return an incorrect result.

Resolution

Cumulative update information

Cumulative Update 2 for SQL Server 2012 SP1

The fix for this issue was first released in Cumulative Update 2. For more information about how to obtain this cumulative update package for SQL Server 2012 SP1, click the following article number to view the article in the Microsoft Knowledge Base:
2790947  (http://support.microsoft.com/kb/2790947/ ) Cumulative update package 2 for SQL Server 2012 Service Pack 1
Note Because the builds are cumulative, each new fix release contains all the hotfixes and all the security fixes that were included with the previous SQL Server 2012 SP1 fix release. We recommend that you consider applying the most recent fix release that contains this hotfix. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
2772858  (http://support.microsoft.com/kb/2772858/ ) The SQL Server 2012 builds that were released after SQL Server 2012 Service Pack 1 was released

Status

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

More information

To reproduce this issue, follow these steps:
  1. Create a table in SQL Server 2012 SP1 named "Test," and insert a record in to the table:
    CREATE TABLE TEST (I DATE);
    
    INSERT INTO TEST VALUES (GETDATE());

  2. Run the following queries to return a correct result:

    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. Then, run the following queries to return an incorrect result:

    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".
    
    

References

For more information about the TRY_CONVERT(Transact-SQL) function, go to the follow MSDN website:
General information about the TRY_CONVERT(Transact-SQL) function (http://msdn.microsoft.com/en-us/library/hh230993.aspx)

For more information the Incremental Servicing Model for SQL Server, click the following article number to view the article in the Microsoft Knowledge Base:
935897  (http://support.microsoft.com/kb/935897/ ) An Incremental Servicing Model is available from the SQL Server team to deliver hotfixes for reported problems
For more information about the naming schema for SQL Server updates, click the following article number to view the article in the Microsoft Knowledge Base:
822499  (http://support.microsoft.com/kb/822499/ ) Naming schema for Microsoft SQL Server software update packages
For more information about software update terminology, click the following article number to view the article in the Microsoft Knowledge Base:
824684  (http://support.microsoft.com/kb/824684/ ) Description of the standard terminology that is used to describe Microsoft software updates

Applies to
  • 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
Keywords: 
kbqfe kbfix kbsurveynew kbexpertiseadvanced KB2778494
Share
Additional support options
Ask The Microsoft Small Business Support Community
Contact Microsoft Small Business Support
Find Microsoft Small Business Support Certified Partner
Find a Microsoft Store For In-Person Small Business Support