Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
BCP Question
Message
De
13/11/1998 11:46:41
Bob Tracy
Independent Consultant
Driftwood, Texas, États-Unis
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Titre:
Divers
Thread ID:
00157393
Message ID:
00157445
Vues:
24
>I have a small Foxpro table (because this is a test) that has the following fields:
>
>C(12), C(10), C(2), C(15), C(2), C(4), C(15), C(6), C(2), C(4), C(1)
>
>And on the SQL Server (6.5 Side) I have the same field names
>as well as the same types (ALl Character, all same Size)
>
>I export out of Foxpro to a SDF File like this:
>
>> COPY TO Export TYPE SDF
>
>This gives me a nice text file. I then run BCP with the following command line:
>
>> bcp SQLFOXUK..Conthist_bcp in Export.txt -Usa -Ptifcbufnt01 - Stifcbufnt01
>
>Okay... Now it asks me the info for the format file, so I bomb through that since the 2 tables' fields are the same lengths etc...
>
>The data gets in, but on the 2nd record it starts moving over 1 character on through the file.. Can anyone tell me what I am missing?? I tried the /r\r Option in BCP and that causes more problems...
>
>Thanx!

Bob,
Here's a sample fmt file I use to bcp data from a text file created by doing a COPY SDF out of VFP. Check to see if your format file looks the same. I sure you know that you can edit the fmt files and call them from the command line when you run bcp: bcp SQLFOXUK..Conthist_bcp in Export.txt /f.... HTH

Bob

6.0
20
1 SQLCHAR 0 16 "" 1 part
2 SQLCHAR 0 30 "" 2 partdesc
3 SQLCHAR 0 2 "" 3 inprev
4 SQLCHAR 0 2 "" 4 inpuom
5 SQLCHAR 0 2 "" 5 insuom
6 SQLCHAR 0 12 "" 6 inconv
7 SQLCHAR 0 3 "" 7 inbcod
8 SQLCHAR 0 5 "" 8 inccod
9 SQLCHAR 0 3 "" 9 inpcod
10 SQLCHAR 0 2 "" 10 inscod
11 SQLCHAR 0 1 "" 11 ecrord
12 SQLCHAR 0 20 "" 12 inlqcst
13 SQLCHAR 0 10 "" 13 inecon
14 SQLCHAR 0 14 "" 14 innqoh
15 SQLCHAR 0 14 "" 15 innnqh
16 SQLCHAR 0 1 "" 16 insrlf
17 SQLCHAR 0 2 "" 17 inabcc
18 SQLCHAR 0 6 "" 18 infldt
19 SQLCHAR 0 6 "" 19 incomcd
20 SQLCHAR 0 2 "\r\n" 20 indrsz
Bob Tracy

Never engage in a battle of wits if you're only half armed.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform