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