Re: CSV import failures in 2005.
- From: "John Bell" <jbellnewsposts@xxxxxxxxxxx>
- Date: Sat, 23 May 2009 08:10:01 +0100
How about scripting out each table and posting the definitions?
John
"Nathan Mellor" <nathan.d.mellor@xxxxxxxxx> wrote in message news:d1d1b3bf-ed1b-4552-98e2-555aefdd7744@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On May 21, 3:38 pm, Erland Sommarskog <esq...@xxxxxxxxxxxxx> wrote:
That's the price you pay for clicking in GUI:s and try to second-guess
them. Why not simply use BCP to extract the data from SQL 2008 server,
and then use it to import?
As long as the databases have the same collation, you can do:
bcp db..tbl out tbl.bcp -n -T -S thatserver
And then to import, you change "out" to "in" and server name and database
name. (Replace -T with -U and -P if you use SQL authentication.)
If the there is a collation mismatch, you need to use a format file,
which still is simple:
bcp db..tbl format nul -n -f tbl.fmt -T -S thatserver
this creates the format file. Then add "-f tbl.fmt" to the commands above.
-n specifies native format. This means that numbers, dates etc cannot
be distorted by the conversion to text. It also means that the data file
will be somewhat smaller and the entire process is somewhat faster.
We are now trying the bcp with -n as you suggest. Ufortuantely, we are
getitng string truncations and unexpected end of file. We even tried
options like -V90 that seemed like a sure winner.
We've tried the command to generate a format file. But it seems to
*expect* a format file, not generate one. Are we supposed to handcode
a format file?
.
- References:
- CSV import failures in 2005.
- From: Nathan Mellor
- Re: CSV import failures in 2005.
- From: Erland Sommarskog
- Re: CSV import failures in 2005.
- From: Nathan Mellor
- CSV import failures in 2005.
- Prev by Date: Re: Trigger help
- Next by Date: Re: Can I Pass a Table Name as a Parameter?
- Previous by thread: Re: CSV import failures in 2005.
- Next by thread: Re: CSV import failures in 2005.
- Index(es):
Relevant Pages
|