Solved

bcp (padding fields)

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

In this article—a derivative of my DaytaBase.org blog post (http://daytabase.org/2011/06/18/what-week-is-it/)—I will explore a few different perspectives on which week today's date falls within using Microsoft SQL Server. First, to frame this stu…
Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
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…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

757 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now