-
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
-
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
-
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
>
>
-
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
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
|
Bookmarks