72 views

Description

In MS SQL, some queries show the following message:

"The data types varchar and ntext are incompatible in the equal operator."

The message occurs because non-integer fields are reported as NTEXT data type. On older versions of the ODBC driver, non-integer fields worked and the message was not displayed.

Steps to Reproduce

 

  1. Configure MS SQL with ODBC driver.
  2. Execute the following MS SQL query:

//----sql----
CREATE TABLE dbo.test_incident 

    short_description varchar(45) NULL, 
)  
ON PRIMARY; 

// the following command fails:
SELECT short_description INTO test_incident FROM incident;

//----sql----

MS SQL error 402: The data types ntext and varchar are incompatible in the equal to operator

Workaround

Casting the field to varchar makes it work correctly, for example:

//----sql----
SELECT cast(short_description as varchar) INTO test_incident FROM incident;
//----sql----


Related Problem: PRB1110116

Seen In

There is no data to report.

Intended Fix Version

London

Fixed In

Kingston

Safe Harbor Statement

This "Intended Fix Version" information is meant to outline ServiceNow's general product direction and should not be relied upon in making a purchasing decision. The information provided here is for information purposes only and may not be incorporated into any contract. It is not a commitment, promise, or legal obligation to deliver any material, code, or functionality. The development, release, and timing of any features or functionality described for our products remains at ServiceNow's sole discretion.

Associated Community Threads

There is no data to report.

Article Information

Last Updated:2018-05-31 17:55:51
Published:2017-08-25