Bcp problem (2005), previously posted to microsoft.public.sqlserver.programming
- From: "Mike C#" <xyz@xxxxxxx>
- Date: Wed, 17 Oct 2007 13:43:46 -0400
This is a repost, I accidentally posted to .programming by mistake (it's
been a long day already). Thanks.
-------------
Having an issue with bcp on 2005, but brain is fried today for some reason.
Any help appreciated. Here's the deal:
I have an XML format file like this:
<RECORD>
<FIELD ID="1" xsi:type="CharTerm" TERMINATOR="|" MAX_LENGTH="50"
COLLATION="Latin1_General_CI_AS"/>
<FIELD ID="2" xsi:type="CharTerm" TERMINATOR="|" MAX_LENGTH="10"
COLLATION="Latin1_General_CI_AS"/>
</RECORD>
<ROW>
<COLUMN SOURCE="1" NAME="ReportingDate" xsi:type="SQLVARYCHAR"/>
<COLUMN SOURCE="2" NAME="PolicyID" xsi:type="SQLVARYCHAR"/>
</ROW>
The source file looks like this:
2007-10-10|ABC123
2007-10-10|DEF456
....
This works great for a table with 2 columns (ReportingDate, PolicyID). When
I add an IDENTITY column, so the destination table looks like this (for
example):
ID INT IDENTITY(1, 1) NOT NULL,
ReportingDate VARCHAR(50),
PolicyID VARCHAR(50)
Bcp and BULK INSERT break when I try to use the format file with the new
IDENTITY column. I've gotten around this problem before, but I'll be darned
if I can remember how. It's probably really simple, but I'm a little out of
it this morning. If anyone has any hints, it's appreciated.
Thanks
.
- Follow-Ups:
- Re: Bcp problem (2005), previously posted to microsoft.public.sqlserver.programming
- From: Erland Sommarskog
- Re: Bcp problem (2005), previously posted to microsoft.public.sqlserver.programming
- Prev by Date: Re: BCP with a query in a file, or SQLCMD outputting tab-delimited?
- Next by Date: Re: BCP with a query in a file, or SQLCMD outputting tab-delimited?
- Previous by thread: Re: SQL2k Profiler: load big trace file into table, on small system ?
- Next by thread: Re: Bcp problem (2005), previously posted to microsoft.public.sqlserver.programming
- Index(es):
Relevant Pages
|