• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 642
  • Last Modified:

bcp (padding fields)

When bulk copying data out of SQL Server 6.5 as fixed length all column get padded with spaces except the last column. Does anyone know how to cause the last field to get padded spaces even if it is null???


Format file:

6.0
6
1       SQLCHAR        0       9       ""        1       ADV_EXPNSE_ID
2       SQLCHAR        0       4       ""        2       EXPNSE_ALLOC_SEQ
3       SQLCHAR        0       3       ""        3       DEPT_ID
4       SQLCHAR        0       4       ""        4       CLASS_ID
5       SQLCHAR        0       4       ""        5       SUBCLASS_ID
6       SQLCHAR        0       7       "\r\n"    6       SKU_ID


Email me at gchadwic@bdsinc.com if you have any questions or solutions...
0
gchadwic
Asked:
gchadwic
1 Solution
 
Victor SpiridonovCommented:
Try adding to your table a 'dummy' field char(1), then previous one will be padded.
0
 
gchadwicAuthor Commented:
I don't think this is a great solution, there has to be a better way.

gchadwic@bdsinc.com
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now