You receive a "Type "http://www.w3.org/2001/XMLSchema:char" is not declared or not a simple type" error message when you try to generate a schema by using the SQL Transport Schema Generation Wizard in BizTalk Server 2004 (897291)



The information in this article applies to:

  • Microsoft BizTalk Server 2004 Enterprise Edition
  • Microsoft BizTalk Server 2004 Standard Edition
  • Microsoft BizTalk Server 2004 Developer Edition
  • Microsoft BizTalk Server 2004 Partner Edition

SYMPTOMS

When you try to generate a schema by using the SQL Transport Schema Generation Wizard in Microsoft BizTalk Server 2004, you receive the following error message:
Type "http://www.w3.org/2001/XMLSchema:char" is not declared or not a simple type. An error occurs at , (0, 0).

CAUSE

This problem occurs when you have a SELECT statement or a stored procedure that returns a column that is defined as either a char(1) data type or an nchar(1) data type.

WORKAROUND

To work around this problem, use one of the following methods:

Method 1

In the SELECT statement or the stored procedure you can cast the column as a char(2) data type or as a varchar(1) data type. For example, the following statement changes the data type from char(1) to char(2).

SELECT CustomerID, CAST(CustomerType as char(2)) as CustomerType FROM customers

Note After you have generated the schema, you can change the SELECT statement or the stored procedure back to the original form.

Method 2

Modify the XDRtoXSD.xslt xml transformation file that BizTalk Server uses to transform the SQL data type to an XML data type. The file is typically located in the C:\Program Files\Microsoft BizTalk Server 2004 folder. To modify the file, first locate the following line on line 899.

<xsl:template mode="convert-datatype" match="@dt:type[.='char']">xs:char</xsl:template>

After you have located the line, change the line to the following, and then save the file.

<xsl:template mode="convert-datatype" match="@dt:type[.='char']">xs:string</xsl:template>

STATUS

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

MORE INFORMATION

For more information about the BizTalk SQL adapter, visit the following Microsoft Developer Network (MSDN) Web site:

Modification Type:MajorLast Reviewed:5/10/2005
Keywords:kbBTSAdapters kbtshoot kbprb KB897291 kbAudDeveloper kbAudITPRO