I’m trying to import a pipe delimited file to sql server 2008. The last column is really long, so it should be varchar(max) or text.
I’m using the import wizard. I’ve set the source to Flat File, and the destination to Sql Native Client.
I’ve set ‘column names in the first data row’.
The wizard correctly reads the column names, but it wants to make each column varchar(50). I found an advanced tab in the wizard where I can set the datatypes, but it only seems to set the type for the data flow and not the destination table? A few dialogs later I can “Edit Mappings”, which lets me map source columns to destination columns, and set whether the destination columns are nullable, but it doesn’t let me set the datatype of the destination columns.
Anyways, I’m confused. Is it possible to import data wider than 50 characters with the wizard? Because it doesn’t seem to want to let me.
Have you tried setting the data type on the data source column to
text stream [DT_TEXT]?When I tested this, it created a column in the destination table of type
text.Edit:
However, if you don’t want to create a table with a deprecated data type (see comment below), I recommend simply creating the table first and then using BULK INSERT: