Results 1 to 6 of 6

Thread: Creating tables from text files?

  1. #1
    Join Date
    Jan 2003
    Posts
    3

    Question Creating tables from text files?

    I have just learned SQL and have started using it. My question, is there a way to create a table using SQL from a flat file, such as a text file? I would think you could use insert but I can't find anything to back up this idea.

    Thanks

  2. #2
    Join Date
    Nov 2002
    Location
    New Jersey, USA
    Posts
    3,932
    If your flat file is properly formatted (comma/tab delimited or fixed length column, etc) you can use bcp or BULK INSERT if you are using SQL Server. For Oracle you can use SQL Loader.

  3. #3
    Join Date
    Jan 2003
    Posts
    3
    What's the SQL Loader? Is that a different tool for SQL? Can you give me a sample of the syntax?

  4. #4
    Join Date
    Nov 2002
    Location
    New Jersey, USA
    Posts
    3,932
    SQL Loader is an Oracle tool, you can check technet.oracle.com to see the syntax.

    It only works with Oracle.

  5. #5
    Join Date
    Jan 2003
    Posts
    3
    thanks for the info, i just got my Oracle disks, so i'll have to check that out. Is there anything special for Sybase? We, a friend and I are trying to figure out a way to create the tables from the flat file for Sybase. Currently it gets done in Access and connect to Sybase, and this takes awhile.

  6. #6
    Join Date
    Nov 2002
    Location
    New Jersey, USA
    Posts
    3,932

Posting Permissions

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