Re: Fixed length records



On Mon, 31 Oct 2005 12:36:06 -0800, Stan wrote:

>I have to build a text file that has 80 character records. I have a number
>of fixed length fields in the file but need to add a 'filler' at the end of
>the fields to get to 80. Do I have to create a dummy variable to do that and
>if so, how?
>Thanks

Hi Stan,

You can't use regular SQL queries to create a text file. You'll have to
use an external utility for that. The ones most commonly used are bcp or
DTS. Both are described in Books Online.

For bcp, the way to add extra space to pad the record length to 80
characters is to use a format file. For DTS, you'll have to look into
the transformation possibilities.

If you need further help, I advise you to post to another newsgroup.
This group is intended for support of English Query, and it's only used
by few people. The group microsoft.public.sqlserver.tools is intended to
support the tools that come with SQL Server (such as bcp and DTS).

Best, Hugo
--

(Remove _NO_ and _SPAM_ to get my e-mail address)
.



Relevant Pages

  • Re: Flat File import fails on large number of rows
    ... What about BCP would not cause this problem that is occuring in DTS? ... Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP) www.SQLDTS.com - The site for all your DTS needs. ... > incident from from a Microsoft Support Professional through Microsoft ...
    (microsoft.public.sqlserver.dts)
  • Re: Efficiently handle mass updates
    ... I suggest you investigate BCP or DTS. ... actually buy SQL Server just to get DTS as it can save a great deal of time ... > before in VBA and it was way quicker. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Dynamic Transforms
    ... This is a Q often asked and in this release of DTS it is a painful ... Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP) www.allisonmitchell.com - Expert SQL Server Consultancy. ... In the past I have used BCP and altered> the various parameters when exporting from SQL Server. ... BCP is not> an option this time as he source is RedBrick. ...
    (microsoft.public.sqlserver.dts)
  • Re: avoid using BCP for snapshot
    ... with bcp you have to bcp into the file ... system and then bcp from the file system to the server. ... for a single table with DTS is is blasted over as a rowset. ...
    (microsoft.public.sqlserver.replication)
  • Re: BCP
    ... If you can schedule a DTS using Enterprise Manager, ... Set it up and make sure it works independently of the rest of the DTS before ... >> You sould execute BCP from a client, not from within a stored procedure. ... >> 'Server' as a linked server, ...
    (microsoft.public.sqlserver.programming)