SQL Server DTS Wizard, field conversion occurs with 202 and 200 errors

Source: Internet
Author: User

When using the DTS Wizard for SQL Server 2012 (Import and export data/imports exported data), the following issues occur:

No problem when the source data is used directly from the table

However, if the source data is a query, the fields will be mapped to (varchar) and 202 (nvarchar)

It is said that Microsoft has solved the bug:https://connect.microsoft.com/sqlserver/feedback/details/772761/ Dtswizard-in-sql-2012-sp1-no-longer-recognizes-nvarchar-varchar-data-types-when-source-is-a-query

But in fact I hit the patch or will be an error.

There is a convenient workaround for comparison:

Open the DTS mapping file (for the 64-bit wizard is C:\Program Files\Microsoft SQL Server\110\dts\mappingfiles\mssqltossis10.xml, for the 32-bit wizard is C \ Program Files (x86) \microsoft SQL Server\110\dts\mappingfiles\mssqltossis10.xml)

Edit the following node:

<!--varchar--><dtm:datatypemapping ><dtm:sourcedatatype><dtm:datatypename>varchar</ Dtm:datatypename></dtm:sourcedatatype><dtm:destinationdatatype><dtm:characterstringtype> <dtm:datatypename>dt_str</dtm:datatypename><dtm:usesourcelength/></dtm: Characterstringtype></dtm:destinationdatatype></dtm:datatypemapping><dtm:DataTypeMapping ><dtm:SourceDataType><dtm:DataTypeName>200</dtm:DataTypeName></dtm:SourceDataType> <dtm:destinationdatatype><dtm:characterstringtype><dtm:datatypename>dt_str</dtm:d Atatypename><dtm:usesourcelength/></dtm:characterstringtype></dtm:destinationdatatype> </dtm:DataTypeMapping>

And

<!--nvarchar--><dtm:datatypemapping ><dtm:SourceDataType><dtm:DataTypeName>nvarchar< /dtm:datatypename></dtm:sourcedatatype><dtm:destinationdatatype><dtm:characterstringtype> <dtm:datatypename>dt_wstr</dtm:datatypename><dtm:usesourcelength/></dtm: Characterstringtype></dtm:destinationdatatype></dtm:datatypemapping><dtm:DataTypeMapping ><dtm:SourceDataType><dtm:DataTypeName>202</dtm:DataTypeName></dtm:SourceDataType> <dtm:destinationdatatype><dtm:characterstringtype><dtm:datatypename>dt_wstr</dtm:d Atatypename><dtm:usesourcelength/></dtm:characterstringtype></dtm:destinationdatatype> </dtm:DataTypeMapping>

and then save. This allows DTS to correctly convert to 200 and 202.

Thanks for the contributors in this article:

https://social.msdn.microsoft.com/forums/sqlserver/en-us/97ff1f01-c02a-4c9a-b867-8eaecc464cfb/2012- Sp1-no-longer-recognizes-common-data-types

SQL Server DTS Wizard, field conversion occurs with 202 and 200 errors

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.