RAPID PUBLISHING ARTICLES PROVIDE INFORMATION DIRECTLY FROM WITHIN THE MICROSOFT SUPPORT ORGANIZATION. THE INFORMATION CONTAINED HEREIN IS CREATED IN RESPONSE TO EMERGING OR UNIQUE TOPICS, OR IS INTENDED SUPPLEMENT OTHER KNOWLEDGE BASE INFORMATION.
↑ Back to the top
When using a parameter marker after any function in a T-SQL statement, SQL Native Client ODBC driver and SQL Server ODBC Driver can return unexpected results.
↑ Back to the top
Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.
↑ Back to the top
WORKAROUND
If a function is used in a T-SQL statement ensure that the column list is ordered in such a way that the parameter markers appear anywhere before the function name.
For example if your T-SQL statement is:
����INSERT INTO Table1 (COL1,COL2,COL3,COL4,COL5,COL6) VALUES (NULL,NULL,CONVERT (DATETIME, NULL),NULL,?,NULL)
To avoid the problem discussed in this article, the above statement should be rewritten as
����INSERT INTO Table1 (COL1,COL5,COL2,COL3,COL4,COL6) VALUES (NULL,?,NULL,CONVERT (DATETIME, NULL),NULL,NULL)
↑ Back to the top
MICROSOFT AND/OR ITS SUPPLIERS MAKE NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY, RELIABILITY OR ACCURACY OF THE INFORMATION CONTAINED IN THE DOCUMENTS AND RELATED GRAPHICS PUBLISHED ON THIS WEBSITE (THE �MATERIALS�) FOR ANY PURPOSE. THE MATERIALS MAY INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS AND MAY BE REVISED AT ANY TIME WITHOUT NOTICE.
TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, MICROSOFT AND/OR ITS SUPPLIERS DISCLAIM AND EXCLUDE ALL REPRESENTATIONS, WARRANTIES, AND CONDITIONS WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO REPRESENTATIONS, WARRANTIES, OR CONDITIONS OF TITLE, NON INFRINGEMENT, SATISFACTORY CONDITION OR QUALITY, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, WITH RESPECT TO THE MATERIALS.
↑ Back to the top