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 in on a file delimited by pipe (|)

Author  Topic 

bobyliu
Starting Member

14 Posts

Posted - 2005-03-31 : 20:27:10
Is there a way to bcp in a file that its fields are delimited by | in sql server 2000? I tried to use access and it apparently doesn't allow me to use the | delimiter as well.

nr
SQLTeam MVY

12543 Posts

Posted - 2005-03-31 : 20:51:29
see
http://www.mindsdoor.net/SQLTsql/BCP_quoted_CSV_Format_file.html

bulk insert ##a from 'c:\bcp.txt' with (FIELDTERMINATOR = '|')


==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

bobyliu
Starting Member

14 Posts

Posted - 2005-03-31 : 22:31:27
yeah... i know you can use bulk insert.. but what about using bcp only? there is a reason i am using only bcp.
Go to Top of Page

nr
SQLTeam MVY

12543 Posts

Posted - 2005-04-01 : 09:21:34
You can do the same thing with bcp.
-t specifies the field terminator.
Have a look in bol.

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -