Thank you Allan.
I created a table first. It had only two fields: recordid, and maintext.
In the data structure, recordid's "identy" was set to "Yes" and increament
"1". Now I went to "Import", select my source file and destination file (the
table just created). In the "transform" section, under "Column Mapping", for
the recordid in the destination file, I selected "<ignore>", which I thought
it would not try to get it from the source file. The next line I mapped the
only column in hte text file to the destination file column "maintext".
Whe I started the transfer, I got an error message saying: "Integrity
violation; attempt to insert Null data or data which violates constraints."
It is true that in the source file there are lines with no data. I have made
in hte structure of column "maintext" to allow null. But apparently the
transfer does not agree with theh data structure. I can try to delete all
the null lines (empty lines) in my source file, but will be tedious.
Any suggestions? Thanks.
[quoted text, click to view] "Allan Mitchell" wrote:
> And what is the error. If you add a primary key column with IDENTITY then make sure you do not point your source columns to this
> column in the destination
>
> Problems With IDENTITY() and the DataPump task.
> (
http://www.sqldts.com/default.aspx?293)
>
> --
>
> Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
>
www.SQLDTS.com - The site for all your DTS needs.
>
www.SQLIS.com - SQL Server 2005 Integration Services.
>
www.Konesans.com >
>
> "pelican" <pelican@discussions.microsoft.com> wrote in message news:4464B480-7D11-4228-B5C4-15F78586D083@microsoft.com...
> > Hello,
> > I have a text file that needs to be read into SQL. I can read the file
> > alright, but I have problems adding a primary key to the SQL table and make
> > it increament automatically. If I read the text file into a new table, the
> > primary key is not created. If I created an empty table and added a primary
> > key at the beginnin of the file, I got an error message and the import just
> > quit. Can anyone guide me on this?
> >
>
>