DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    rkbnair Guest

    Copying data across


    What is the syntax to copy the data from a table "mytable" to a plain text
    file delimited with tab?

    Also, how can import the same data back?

    Should we use the BCP utility? If so, what syntax?

    Thanks


  2. #2
    Neil Pike Guest

    Re: Copying data across

    Use BCP and the syntax is in the docs

    Neil Pike MVP/MCSE. Protech Computing Ltd
    (Please reply only to newsgroups)
    SQL FAQ (428 entries) see
    forumsb.compuserve.com/gvforums/UK/default.asp?SRV=MSDevApps (sqlfaq.zip - L7
    - SQL Public)
    or www.ntfaq.com/sql.html
    or www.sql-server.co.uk
    or www.mssqlserver.com/faq



  3. #3
    rkbnair Guest

    Re: Copying data across


    Hi Neil,

    Thanks for the message. I went to the site which u mentioned and still couldn't
    work out why I cannot run the bcp utility. It accepts the command and goto
    an infinite process

    This is the command I typed in the Query analyzer.

    [master].[dbo].xp_cmdshell "bcp tbl_clients out clients.txt"

    Thanks


    Neil Pike <neilpike@compuserve.com> wrote:
    >Use BCP and the syntax is in the docs
    >
    > Neil Pike MVP/MCSE. Protech Computing Ltd
    > (Please reply only to newsgroups)
    > SQL FAQ (428 entries) see
    > forumsb.compuserve.com/gvforums/UK/default.asp?SRV=MSDevApps (sqlfaq.zip

    - L7
    >- SQL Public)
    > or www.ntfaq.com/sql.html
    > or www.sql-server.co.uk
    > or www.mssqlserver.com/faq
    >
    >



  4. #4
    Neil Pike Guest

    Re: Copying data across

    The docs I mention are the SQL Books Online. Look up BCP in that and run it
    from a command prompt - if you get the syntax wrong it will tell you. For a
    start you need to specify a userid/password to connect with....

    > Thanks for the message. I went to the site which u mentioned and still

    couldn't
    > work out why I cannot run the bcp utility. It accepts the command and goto
    > an infinite process
    >
    > This is the command I typed in the Query analyzer.
    >
    > [master].[dbo].xp_cmdshell "bcp tbl_clients out clients.txt"
    >
    > Thanks
    >
    >
    > Neil Pike <neilpike@compuserve.com> wrote:
    > >Use BCP and the syntax is in the docs
    > >
    > > Neil Pike MVP/MCSE. Protech Computing Ltd
    > > (Please reply only to newsgroups)
    > > SQL FAQ (428 entries) see
    > > forumsb.compuserve.com/gvforums/UK/default.asp?SRV=MSDevApps (sqlfaq.zip

    > - L7
    > >- SQL Public)
    > > or www.ntfaq.com/sql.html
    > > or www.sql-server.co.uk
    > > or www.mssqlserver.com/faq
    > >
    > >

    >


    Neil Pike MVP/MCSE. Protech Computing Ltd
    (Please reply only to newsgroups)
    SQL FAQ (428 entries) see
    forumsb.compuserve.com/gvforums/UK/default.asp?SRV=MSDevApps (sqlfaq.zip - L7 -
    SQL Public)
    or www.ntfaq.com/sql.html
    or www.sql-server.co.uk
    or www.mssqlserver.com/faq



Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links