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

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2004-03-22 : 08:42:48
Daryl writes "I am BCP'ing data out of a table and would like to limit the column length of a field from 25 to 20. Is there a method other than using queryout?"

robvolk
Most Valuable Yak

15732 Posts

Posted - 2004-03-22 : 08:44:43
You *might* be able to use a format file to do this, but I haven't tried it and you might get an error. Books Online has details on format files, you can have bcp generate one for you and then edit it (much easier).
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2004-03-22 : 09:11:06
Or create a view and bcp that out...


CREATE VIEW myView99
AS
SELECT CONVERT(Char(25), Col1) AS New_Col1
FROM myTable99




Brett

8-)
Go to Top of Page
   

- Advertisement -