Solved

bcp (padding fields)

Posted on 1998-07-07
2
569 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
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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SQL Improvement  ( Speed) 14 28
Unable to Uninstall Visual Studio 2015 7 27
Create snapshot on MSSQL 2012 3 20
abs operation in sql server 15 15
When you hear the word proxy, you may become apprehensive. This article will help you to understand Proxy and when it is useful. Let's talk Proxy for SQL Server. (Not in terms of Internet access.) Typically, you'll run into this type of problem w…
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

803 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