I am trying to import data from one database in a server to a new table in a different server, using SQL Server import and Export Wizard. (SQL Server Management Studio 2012)
In the wizard, I checked "Write a query to specify the data to transfer", and the SQL statement returns data containing the following four columns:
+-----------------------------------------------------------------------------+
| ID(varchar(100)) | Title(text) | Description(text) | IsActive(tinyint)|
+-----------------------------------------------------------------------------+
I want to change the types for the new table to
+----------------------------------------------------------------------------------------+
| ID(varchar(4)) | Title(varchar(200)) | Description(varchar(2000)) | IsActive(bit)|
+----------------------------------------------------------------------------------------+
So, in the "Column Mappings" page(In the "Select Source Tables and Views" page, I clicked "Edit Mappings..."), I changed the Destination Type to the above types.
Then, after clicking "Next", in the "Review Data Type Mapping" page, I get an error that says "Found 3 unknown column type conversion(s). You are only allowed to save the package
"
The Data type mapping shows the following information:
icon Source Column Source Type Destination Column Destination Type Convert
----------------------------------------------------------------------------------
error ID 200 ID varchar
error Title 200 Title varchar
error Description 201 Description varchar
warning IsActive tinyint IsActive bit
Even if I don't change the data type in the "Edit Mappings..." page, I get the same error.
I don't understand what "200" means in the context of a data type, and how can I import this data to a new table in a different server?
I appreciate any help.
With a bit of experimentation this error only seems to occur when you have a query as the source. The accepted answer did not work for me as copying to a flat file would result in the same error.
To solve this I put my query into a View
then selected Copy From one or more Tables Or Views
instead of Write a query...
.
I went through the wizard normally after that and my data went through with no error