Solved

How to create a simple SQL table from a txt file

Posted on 2011-02-13
4
292 Views
Last Modified: 2012-05-11
I am a beginner programmer.
I need to create an sql table from a text file.
I need to have 6 columns and since the file is large, I don't know how many rows I need.

I need a very step by step tutorial.
0
Comment
Question by:pgmerLA
4 Comments
 
LVL 26

Expert Comment

by:tigin44
ID: 34884072
do your text file has any structure on the rows... if so you can use the import/export wizard to create your table. By the way you dont need to know the row number of your table. you should be care just the columns and their data types. I f you can provide a sample data we may guide you more
0
 

Author Comment

by:pgmerLA
ID: 34884277
Here is a sample of a txt file I need to create an sql table for.
OCENY.txt
0
 
LVL 32

Accepted Solution

by:
ewangoya earned 500 total points
ID: 34884368
First you need to create a databse in SQL Server
Open SQL Server  Management Studio (SSMS)
Right click on Databases and select New Database

Enter the name of your database and click OK
Now you have a new database, you have to create the table

The easiest way for you is to use the Import\Export wizard
Right click on the database you just created, select
Tasks-> Import Data...

Follow the wizard
For your Data source, select Flat File from the drop down list, then browse for the file and select it
Follow through the wizard and your table will be created and populated.


New-Database.png
0
 
LVL 40

Expert Comment

by:Sharath
ID: 34885676
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
SQL server is using more virtual memory. 5 84
SQL Server Question 5 36
Rename SQL Instance/SQL Developer Edition 2012 2 19
TOOLS - convert T-SQL TO PL/SQL 3 24
In this article I will describe the Detach & Attach method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question