Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

bcp (padding fields)

Posted on 1998-07-07
2
Medium Priority
?
635 Views
Last Modified: 2010-07-27
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
Comment
Question by:gchadwic
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 7

Accepted Solution

by:
Victor Spiridonov earned 200 total points
ID: 1091680
Try adding to your table a 'dummy' field char(1), then previous one will be padded.
0
 

Author Comment

by:gchadwic
ID: 1091681
I don't think this is a great solution, there has to be a better way.

gchadwic@bdsinc.com
0

Featured Post

Independent Software Vendors: 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!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What if you have to shut down the entire Citrix infrastructure for hardware maintenance, software upgrades or "the unknown"? I developed this plan for "the unknown" and hope that it helps you as well. This article explains how to properly shut down …
Ready to get certified? Check out some courses that help you prepare for third-party exams.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question