SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Zealot toograffic's Avatar
    Join Date
    Mar 2002
    Location
    Sarasota, Florida
    Posts
    192
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    MS SQL - .txt files as linked tables?

    I am "upgrading" one of my db from Access to MSSQL. I am using two .txt files in the same folder as my Access db as linked tables.

    How can this be done in MSSQL? The .txt files contain tab de-limited data that is uploaded to my server every day, and I have a script that combines the data as it inserts it into one of the other db tables.

    This is my first MSSQL database, so my only frame of reference is what I have done using Access.
    The two most common elements in the universe are hydrogen
    and stupidity. - Harlan Ellison
    Retirement Communities and Senior Housing Options
    Freecycle.org

  2. #2
    SitePoint Guru dale_burrell's Avatar
    Join Date
    Aug 2002
    Location
    Wellington, New Zealand
    Posts
    861
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Personally I would write a stored procedure to pick up the file, parse it and insert it into the database.

    If your SQL server doesn't have access to the filesystem then I would write a script to parse the file and insert it into the database.
    If you aren't living life on the edge
    - you're taking up too much space
    Creative Dreaming Ltd / Ask The Local / Amanzi Travel

  3. #3
    SitePoint Zealot toograffic's Avatar
    Join Date
    Mar 2002
    Location
    Sarasota, Florida
    Posts
    192
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks, Dale. I have no idea how to do either of those options at this point. I have got to find a source of info on MS SQL that makes sense to someone without any formal training - everything I've seen so far takes for granted that you know all the acronyms and syntax already.
    The two most common elements in the universe are hydrogen
    and stupidity. - Harlan Ellison
    Retirement Communities and Senior Housing Options
    Freecycle.org

  4. #4
    SitePoint Guru SteveO's Avatar
    Join Date
    Jan 2003
    Posts
    625
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    take a look around on the microsoft.com site and look, in particular, for SQL Server books. They are free and very helpful for MSSQL-specific syntax.


  5. #5
    SitePoint Guru dale_burrell's Avatar
    Join Date
    Aug 2002
    Location
    Wellington, New Zealand
    Posts
    861
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Parsing files in T-SQL isn't for the faint-hearted. The faster solution might be to script the parsing if your site is ASP, ASP.NET or PHP or anything else that can parse files and connect to a database.
    If you aren't living life on the edge
    - you're taking up too much space
    Creative Dreaming Ltd / Ask The Local / Amanzi Travel


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
  •