Microsoft KB Archive/281535

= You receive a &quot;22001[Microsoft][ODBC SQL Server Driver]String data, right truncation&quot; error message when you run or debug a SQL Server 2000 stored procedure in Visual C++ 6.0 =

Article ID: 281535

Article Last Modified on 6/3/2005

-

APPLIES TO


 * Microsoft Visual C++ 6.0 Enterprise Edition
 * Microsoft SQL Server 2000 Standard Edition

-



This article was previously published under Q281535



SYMPTOMS
When you use Visual C++ 6.0 to run or debug a SQL Server 2000 stored procedure with a sql_variant type input parameter, the following error message occurs:

&quot;22001[Microsoft][ODBC SQL Server Driver]String data, right truncation&quot;



MORE INFORMATION
Microsoft SQL Server 2000 introduces a new data type called sql_variant. You can use the sql_variant data type to store values of various SQL Server-supported data types except text, ntext, image, timestamp, and sql_variant. In Visual C++ 6.0, you cannot run or debug a SQL Server 2000 stored procedure with an input parameter of type sql_variant.

Steps to Reproduce Behavior
 Create a new Database Project in Visual C++ 6.0. Switch to the project's Data View. From the Insert menu, click New Database Item. This opens the Insert Database Item dialog box. Select Stored Procedure from the Database Item list box, and then click OK.  In the Edit window, create a stored procedure as follows: Create Procedure Test @test sql_variant As return 5  Execute or debug the project. A message box appears with the following error message:

&quot;22001[Microsoft][ODBC SQL Server Driver]String data, right truncation&quot;

</ol>

<div class="references_section">