Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

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


View products that this article applies to.

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).

↑ Back to the top


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.

↑ Back to the top


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>

↑ Back to the top


Status

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

↑ Back to the top


More information

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

↑ Back to the top


Keywords: KB897291, kbprb, kbtshoot, kbbtsadapters

↑ Back to the top

Article Info
Article ID : 897291
Revision : 3
Created on : 3/16/2007
Published on : 3/16/2007
Exists online : False
Views : 612