Hello I need to export my table fixed filed size by making numbers 15 characters right alignment and strings 20 characters left alignment.
You could define a view or use a query that contains the expressions to produce the character format of the data and use it to export the data. Ex:
bcp "select right(replicate(space(1), 15) + cast(numcol as varchar), 15) as numcol, cast(stringcol as char(20)) as stringcol from tbl" queryout ....
But this is probably not a task for SQL or command-line utilities. You could use DTS/SSIS packages but I am not sure of the performance implications. Ask in the SSIS forum.
No comments:
Post a Comment