Results 1 to 4 of 4

Thread: bcp and sql

  1. #1
    wing Guest

    bcp and sql

    hi,

    I`m in the process of archiving some data from my database. I intent to use
    the bcp command to unload data to text file. But I need also want to include
    some sql statements inside the bcp command so that i can selectively unload my
    data.

    I have tried the -i option where I have include by sql file but bcp ignores
    the sql file and unloads all the data from the file. Has anyone tried bcp with
    sql statements before ?

    TIA,
    Wing

  2. #2
    Guest

    bcp and sql (reply)

    On 8/30/98 8:46:34 PM, wing wrote:
    > hi,

    I`m in the process of archiving some data from my database. I intent
    > to use
    the bcp command to unload data to text file. But I need also want
    > to include
    some sql statements inside the bcp command so that i can
    > selectively unload my
    data.

    I have tried the -i option where I have
    > include by sql file but bcp ignores
    the sql file and unloads all the data
    > from the file. Has anyone tried bcp with
    sql statements before ?

    TIA,
    Wing



    Wing,

    I haven`t tried using the -i option to do that. But here`s another option if you don`t get that to work. You can use a Select Into query in ISQL to filter your data from the archive table and place it in a separate table. Then just bcp THAT table out.

    Good luck.


    Lisa

  3. #3
    VK Guest

    bcp and sql (reply)

    Create a view and than BCP this view out.

    VK.

  4. #4
    Guest

    bcp and sql (reply)

    On 8/31/98 9:59:00 AM, VK wrote:
    > Create a view and than BCP this view out.

    VK.

    thanks VK

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •