advertisement

Article:
  Faster Filtered SQL Server Imports
Subject:   Questions about BCP and CPAN
Date:   2007-01-15 01:21:41
From:   CPG
Response to: Questions about BCP and CPAN

As an example of the flexibility of using this DTS module, you only need to adjust two parameters to import fixed width data from a file. In the connectToFile() subroutine, set the ‘File Format’ to 2, and replace the ‘Column Delimiter’ parameter with ‘Column Lengths’, set to the lengths of the fixed width fields. For example, if there are three fields of length 6, 25 and 25, use the following settings (passed as parameters):-


$Conn->ConnectionProperties->{"File Format"}->{Value} = 2;
$Conn->ConnectionProperties->{"Column Lengths"}->{Value} = "6,25,25";