473,466 Members | 1,368 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Merge Tables into One

39 New Member
I want to expand upon this now (of course) and during the import, take that road name and dataset name and insert it into a seperate table. This will allow me to link all the data from the imported tables. Should I start a seperate thread for that?

** Edit **
Split away from How to import multiple text file data sets into their own table.
Mar 8 '11 #1
4 1997
TheSmileyCoder
2,322 Recognized Expert Moderator Top Contributor
There is no need to apologize. You have been very good at describing both your original question, and giving good and relevant information along the way, which makes a world of difference.

Anyways, normally new questions go in new threads. Though I dont really know if thats a new question.

Now from a design point of view, I wouldn't choose the path you are choosing, unless you have very few different road names. Just imagine 20 road names, gives you 20 tables, and then making 20 queries, and if say the txt file gets another field, you have to update all 20 tables (without making human errors...) and the queries.

Now I would do:
1) Import file to temporary table.
2) Get road name. Check if its a known road name, or new road name. If new, insert into table of road names. Get the Primary Key of the tbl_RoadNames.
3) Append the temporary table+Primary Key into the main table, in which there is a Foreign Key field for the road ID.

That gives you all your data in one table (less maintenance) and makes it easier to query.
You can do step 2 as well for the dataset ID.

I hope that was clear enough.
Mar 8 '11 #2
Miguel Valenzue
39 New Member
Thanks. That was very clear. I'll look into it and build upon this and get back with my results.
Mar 8 '11 #3
Miguel Valenzue
39 New Member
Hi Smiley,
When I use the import wizard it allows me to ad a unique ID into my table. The saved import spec doesn't allow this. How do I go about automating the inclusion of the unique ID into the table?
thanks
Mar 17 '11 #4
TheSmileyCoder
2,322 Recognized Expert Moderator Top Contributor
That depends. If you used my suggested approach of importing to a temporary table, you can simply add a autonumber column to your temporary table.

Otherwise you can add a autonumber to the table, after the import (can be done through VBA).
Mar 17 '11 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Pierre-Luc Soucy | last post by:
Hi, I was working on some merge tables this morning and it worked fine, but after a few unsuccessful table creation requests (I was making some tests), I could not alter or select from a table...
0
by: Johannes B. Ullrich | last post by:
--=-WKgoK98ejo9BZyGYc3N/ Content-Type: text/plain Content-Transfer-Encoding: quoted-printable I am having problems with MySQL 4.0.12 on RedHat Advanced Server 2.1 using a dual Xeon with 8...
1
by: Shane Niebergall | last post by:
If I have a merge table that is made up of a set of tables and I want to change the structure of the underlying tables, how do I do it? Will I be allowed to change each table one at a time even...
2
by: Dave | last post by:
Hi everyone. I have an interesting problem. We have two PHP shops that use MySQL databases. The database structures are exactly he same. Due to the two companies now working together we want the...
2
by: mfyahya | last post by:
I have two tables, both containing an 'authors' column. Is there a way to get a unique list of authors from the two tables? I tried SELECT DISTINCT `authors` from `table1`, `table2`; but I got an...
48
by: phillip.s.powell | last post by:
MySQL 3.23.58 - 4.0.17 (yep, several database server instances, don't ask) I have database Spring with table Students I have database Summer with table Students I am tasked to produce a...
2
by: admin | last post by:
I was wondering if there is a way to create a merge table using where clauses for the underlying tables. I have a date column in all tables and would like to have it so that I could just inset say...
2
by: JK | last post by:
I saw Danny Lesandrini's article on Database Journal (http://www.databasejournal.com/features/msaccess/article.php/2236471) on how to merge tables from identical databases. This is exactly what...
0
by: raviee | last post by:
Hi Can anyone help me how to merge two database with all objects in sql server 2005. I have two database ie. a.MDF, b.MDF i want a new database c.mdf . simple merge only merge tables... i want...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.