Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 BCP not working (bad format)

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-05-10 : 09:19:43
Jason Newland writes "I am trying to run bcp to export data to a txt file, but I can't seem to get the file to run. Can someone shoot me a good example of BCP to create a txt file using SQL2000. The query I want to run is this: select login,password,firstname from subaccounts where status = 1



Thanks in advance.


jason"

YellowBug
Aged Yak Warrior

616 Posts

Posted - 2002-05-10 : 10:57:34
Look in BOL for "Copying Data From a Query to a Data File"
Remember to state the database name in your select statement.

c:> bcp "select login,password,firstname from <database>..subaccounts where status =1 " queryout Authors.txt -c -Sservername -Usa -Ppassword

Go to Top of Page
   

- Advertisement -