Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

bcp

0 views
Skip to first unread message

Graham Charles

unread,
Nov 23, 1998, 3:00:00 AM11/23/98
to
In character mode, you use the /t and /r flags to indicate the field and
record delimiters you want to use; if you want to be selective about the
fields you're exporting, use a view.

G.

Graham Charles
Ars Indicii Information Design
http://www.sirius.com/~gcharles

MT wrote in message <73d3ob$erd$1...@titan.xtra.co.nz>...
>Hi
>
>I'm going to bcp some data out of SQL Server to a text file. If I use the
>option -f format_file in the bcp command, the output file will be in native
>format - which is not readable. If I use -c -f both, SQL Server won't
>accept -c -f at the same time. I hope to copy several columns not all
>columns from the tables to a ascii file uising bcp, but I failed to do
>that. Anyone can help me?

MT

unread,
Nov 24, 1998, 3:00:00 AM11/24/98
to
Hi

I'm going to bcp some data out of SQL Server to a text file. If I use the
option -f format_file in the bcp command, the output file will be in native
format - which is not readable. If I use -c -f both, SQL Server won't
accept -c -f at the same time. I hope to copy several columns not all
columns from the tables to a ascii file uising bcp, but I failed to do
that. Anyone can help me?

(The command I used:

bcp dbname..tables out table.out -Uuser -Ppass -f bcp.fmt

)

Many thanks

Michael

Dan Guzman

unread,
Nov 24, 1998, 3:00:00 AM11/24/98
to
You can create a view with the desired columns and bcp data out with '-c'.

Hope this helps.

MT wrote in message <73d3ob$erd$1...@titan.xtra.co.nz>...

Tom Hummel, International Superstar

unread,
Nov 24, 1998, 3:00:00 AM11/24/98
to
Others have hopefully answered your question on how to eliminate some
fields from your BCP list. With regards to the output file being in
native format, if you want a text file to be generated, when you
create your format file you should use CHAR as the data type for all
of your fields, regardless of what they really are. Just be sure that
you give enough room for the field to fit when selecting the char
length. I do that exact same thing in my database and it works. Post
here if you have any other problems with it and I may be able to send
you the format file that I use along with the command line that I run
to do the export.

-Tom.

"MT" <xmt...@yahoo.com> wrote:
>Hi
>
>I'm going to bcp some data out of SQL Server to a text file. If I use the
>option -f format_file in the bcp command, the output file will be in native
>format - which is not readable. If I use -c -f both, SQL Server won't
>accept -c -f at the same time. I hope to copy several columns not all
>columns from the tables to a ascii file uising bcp, but I failed to do
>that. Anyone can help me?
>
>(The command I used:
>
>bcp dbname..tables out table.out -Uuser -Ppass -f bcp.fmt
>
>)
>
>Many thanks
>
>Michael
>
>

Please email all replies to: t...@infopackaging.com

0 new messages