Article ID: 281535 - Last Review: June 3, 2005 - Revision: 4.1

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

This article was previously published under Q281535

On This Page

Expand all | Collapse all

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:
"22001[Microsoft][ODBC SQL Server Driver]String data, right truncation"

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

  1. Create a new Database Project in Visual C++ 6.0.
  2. Switch to the project's Data View.
  3. 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.
  4. In the Edit window, create a stored procedure as follows:
    Create Procedure Test @test sql_variant
    As
    return 5
    					
  5. Execute or debug the project.
  6. A message box appears with the following error message:
    "22001[Microsoft][ODBC SQL Server Driver]String data, right truncation"

REFERENCES

For more information, refer to the Visual Studio 6.0 Service Pack 5 Readme.txt file.

APPLIES TO
  • Microsoft Visual C++ 6.0 Enterprise Edition
  • Microsoft SQL Server 2000 Standard Edition
Keywords: 
kberrmsg kbtshoot kbdatabase kbprb kbtsql KB281535
 

Article Translations

 

Related Support Centers