Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9147065
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T10:53:51+00:00 2026-06-17T10:53:51+00:00

Ok, I am learning SQL and just installed SQL Server. I’ve read about outer

  • 0

Ok, I am learning SQL and just installed SQL Server. I’ve read about outer joins and inner joins but am not sure either is what I want. Basically, I want to reconstruct a text file that has been “chopped” up into 5 smaller text files. The columns are the same across all 5 text files, e.g. name, age, telephone #, etc. The only difference is that they have different numbers of rows of data.

What I’d like to do is “append” the data from each file into one “mega-file”. Should I create a table containing all of the data, or just create a view? Then, how do I implement this…do I use union? Any guidance would be appreciated, thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T10:53:52+00:00Added an answer on June 17, 2026 at 10:53 am

    Beyond your immediate goal of merging the five files it sounds like you want the data contained in your text files to be generally available for more flexible analysis.

    An example of why you might require this is if you need to merge other data with the data in your text files. (If this is not the case then Oded is right on the money, and you should simply use logparser or Visual Log Parser.)

    Since your text files all contain the same columns you can insert them into one table*.

    1. Issue a CREATE statement defining your table
    2. Insert data into your newly created table**
    3. Create an index on field(s) which might often be used in query predicates
    4. Write a query or create a view to provide the data you need

    *Once you have your data in a table you can think about creating views on the table, but to start you might just run some ad hoc queries.

    **Note that it is possible to accomplish Step 2 in other ways. Alternatively you can programmatically construct and issue your INSERT statements.

    Examples of each of the above steps are included below, and a tested example can be found at: http://sqlfiddle.com/#!6/432f7/1

    -- 1.
    CREATE TABLE mytable 
        (
         id int identity primary key, 
         person_name varchar(200), 
         age integer,
         tel_num varchar(20)
        );
    
    -- 2. or look into BULK INSERT option https://stackoverflow.com/q/11016223/42346
    INSERT INTO mytable
        (person_name, age, tel_num)
    VALUES
        ('Jane Doe', 31, '888-888-8888'),
        ('John Smith', 24, '888-555-1234');
    
    -- 3.
    CREATE UNIQUE INDEX mytable_age_idx ON mytable (age);
    
    -- 4.
    SELECT id, person_name, age, tel_num
    FROM mytable
    WHERE age < 30;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Just learning about sql joins and things, and I have a question. Can you
I'm not very good at SQL, but I'm certainly learning. So this one provides
Just started learning about SQL, and doing very basic stuff using SQLPlus. I've literally
I'm learning SQL at the moment and I've read that joins and subqueries can
So I am just learning .NET, WinForms, SQL Server and C#.... I previously have
So I just recently started learning about how databases work, how to use SQL
I just started learning LINQ to SQL, and so far I'm impressed with the
I'm learning SQL Server Compact for a program I'm writing that requries a local
The setup: Winform/ASP.NET MVC projects. Learning NHibernate SQL-Server driven apps I work with clients
I'm in the process of learning Databases and SQL. From what I have read

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.