Sunday 16 April 2017

Writing SQL Server data to fixed length format file

     

      SQL Server provides different ways to write data to file system like BCP, BAT FILE, XP_CMDSHELL, OLE Automation Object. We can write data in file system in different format like delimiter separated, fixed length format here we are explain fixed length file format.

There are several ways to write data from SQL Server to file system using some intermediate tool like SSIS or other ETL tools, but when you need to write data without using any tool then its bit challenge.

Requirement: Write table data to the file in fixed length format for a selected Id.
      
   
     What is a fixed length file?


Fixed width text files are special cases of text files where the format is specified by column widths, pad character and left/right alignment.  Column widths are measured in units of characters. For example, if you have data in a text file where the first column always has exactly 10 characters, and the second column has exactly 5, the third has exactly 12 (and so on); this would be categorized as a fixed width text file.

  I have written a white paper for details process, below is the link:


Click Here :Download White paper


No comments:

Post a Comment

Data Mesh

  Data Mesh is a relatively new approach to managing and organizing data within organizations, especially large enterprises. It advocates fo...