RE: BCP Format Files

From: Nigel Rivett (sqlnr_at_hotmail.com)
Date: 05/01/04


Date: Sat, 1 May 2004 00:31:02 -0700

Don't think I have ever used a format file for an extract.
bcp will take a query and you can use that to format the data.
You can also build up the extract in a glabal temp table with a single character column and extract that.

If you are doing a lot of these you might want to hold the structure and source of the output in metadata in tables so that the extract is a single SP for all extracts and a new extract is just a mater of adding data to the tables.

I have a metod of doing this for import here
http://www.nigelrivett.net/MoveImportData.html
the export is a lot simpler as you don't have to split rows into separate tables.



Relevant Pages

  • Re: BCP Nightly Extracts
    ... > application database to many extract files each night. ... To include the column header as part of the file, ... Unless the quotes are part of the data, you need to use a format file ... Books Online for SQL Server SP3 at ...
    (microsoft.public.sqlserver.programming)
  • Re: CSV import failures in 2005.
    ... Why not simply use BCP to extract the data from SQL 2008 server, ... If the there is a collation mismatch, you need to use a format file, ... Then add "-f tbl.fmt" to the commands above. ...
    (microsoft.public.sqlserver.programming)
  • Re: BCP Format Files
    ... >> Don't think I have ever used a format file for an extract. ... a query and you can use that to format the data. ... i never managed to import native format bcp files w/o a format file. ...
    (microsoft.public.sqlserver.programming)
  • pcap
    ... Anyone know of if there is a java class that extract every field of a pcap ...
    (comp.lang.java)
  • Re: Find Specific Record in database Table via VB code
    ... intSearchAtty had been defined as DIM intSearchAtty As Integer and then using ... Programmer Analyst II ... I've attempted to use a macro calling a query to ... >> I'm not sure if I need to use a query to get the record, then extract ...
    (microsoft.public.access.formscoding)