Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL BCP Files Into FoxPro
Message
 
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01416196
Message ID:
01416265
Views:
65
This message has been marked as the solution to the initial question of the thread.
They exported data in the SQL Server native format (-n switch). It's only appropriate for transferring data between multiple instances of SQL Server because it stores all non-character data in internal SQL Server format. You've 2 options:
- Ask them to export data into ASCI format
- Install SQL Server and import data using the same BCP utility. The SQL Server Express edition is free and Developer Edition is very cheap.

>I've been provided from a client many files that were exported from their SQL Server database using the BCP utility, with matching format files for each table. The files have a .TXT extension but are not readable ASCII text. I need to somehow get this data into VFP tables.
>
>1. How can I tell what the format of these files is?
>2. How do I manipulate/convert it to be able to import into VFP?
>
>I need to do my work from VFP, as we don't have SQL Server here to do anything with the files.
>
>Here is the command the client used to pull one of the files:
>
>C:\WINDOWS\system32>bcp "SELECT * FROM [RE7].dbo.Appeal Where ( (0 = 0) Or (DateChanged >= Convert(varchar, DateAdd(d, -0, GetDate()), 101)))" queryout "D:\MSSQL\BACKUP\Masterworks Scripts\Output\Appeal.txt" -SRE-sQL -T -n
>
>And here is the command they used to create a format file:
>C:\WINDOWS\system32>bcp [RE7].dbo.Appeal format nul -S -T -n -f "D:\MSSQL\BACKUP\Masterworks Scripts\Output\Format_Appeal.txt"
>
>Thanks,
>Ron
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform