Solved

bcp (padding fields)

Posted on 1998-07-07
2
610 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:
spiridonov earned 100 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

The Ultimate Checklist to Optimize Your Website

Websites are getting bigger and complicated by the day. Video, images, custom fonts are all great for showcasing your product/service. But the price to pay in terms of reduced page load times and ultimately, decreased sales, can lead to some difficult decisions about what to cut.

Question has a verified solution.

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

Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
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.
Viewers will learn how the fundamental information of how to create a table.

696 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