Professional Web Applications Themes

Best way to query a flat fixed length text file - Microsoft SQL / MS SQL Server

I am trying to insert a semi fixed length file into a SQL database. Does anyone know of a way to query a fixed length file like you can a csv to only insert the records that meet certain criteria? So far, I have had success using vbscript to open the file and then p out the lines, but I am wondering if there is a more efficient method? Thanks for any help....

  1. #1

    Default Best way to query a flat fixed length text file

    I am trying to insert a semi fixed length file into a SQL database.
    Does anyone know of a way to query a fixed length file like you can a
    csv to only insert the records that meet certain criteria? So far, I
    have had success using vbscript to open the file and then p out
    the lines, but I am wondering if there is a more efficient method?

    Thanks for any help.
    Random Guest

  2. #2

    Default Re: Best way to query a flat fixed length text file

    See if the way I use the ODBC text driver to query a DOS
    directory listing is any help:

    [url]http://www.users.drew.edu/skass/sql/TextDriver.htm[/url]

    You could also bcp or bulk insert the entire file in and then evaluate
    the criteria. There are options, so play around and see
    what's efficient.

    Steve Kass
    Drew University

    Random wrote:
    >I am trying to insert a semi fixed length file into a SQL database.
    >Does anyone know of a way to query a fixed length file like you can a
    >csv to only insert the records that meet certain criteria? So far, I
    >have had success using vbscript to open the file and then p out
    >the lines, but I am wondering if there is a more efficient method?
    >
    >Thanks for any help.
    >
    >
    Steve Kass Guest

Similar Threads

  1. Replies: 0
    Last Post: November 16th, 06:09 PM
  2. Create text file from query
    By Efused in forum Coldfusion - Getting Started
    Replies: 1
    Last Post: September 13th, 06:05 PM
  3. Fixed Length Text Extract, Write to Excel
    By William Martell in forum PERL Beginners
    Replies: 4
    Last Post: January 7th, 06:25 PM
  4. Replies: 0
    Last Post: August 22nd, 10:37 PM
  5. Replies: 0
    Last Post: January 8th, 02:59 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139