You are here: Re: Appending tables « MsSQL Server « IT news, forums, messages
Re: Appending tables

Posted by Shwetabh on 03/09/06 06:03

Erland Sommarskog wrote:
> Shwetabh (shwetabhgoel@gmail.com) writes:
> > Well I cant really do anything about the design for table2 because that
> > is the way the client wants it to be.
> >
> > As far as table3 goes, I wanted to check the possiblility of appending
> > the
> > records of all the tables into a single table and check the performance
> > and
> > efficiency. I understand that table3 is a poor database design
> > but the main motivation for doing this is to check the reaction of the
> > application
> > which will using such database.
> >
> > Also, till now, I have converted DBASE database into SQL database using
> >
> > OPENROWSET to import the data, I was wondering if the same database
> > can be entered into a new table which can hold the data from all
> > tables.
> >
> > Any ideas?
>
> For it to be meaningful to merge table1 and table2 into one table,
> there must be some relation between the data. Is there any such relation?
>
> In your sample data PRT1 went with CAT1, but you did not indicate what
> rule said that these two should go together.
>
> If you don't know what you want, we will not know either.
>
> --
> Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
>
> Books Online for SQL Server 2005 at
> http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
> Books Online for SQL Server 2000 at
> http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

Hi,

Please disregard the sample data for now. I had missed a field in table
2 there.
Let's look at the schema I have given for table 1,2,3. Here, I am able
to create
table 3 programmatically and it successfully creates all the columns in
table 1
and table 2.

As for the rules, let me make it clearer. The application (EasyLabel
from www.tharo.com) will be using this database. This application is
used to create labels. Each label consists of various components like
barcodes,images etc. The data for this label is mapped to the fields in
the database. The user enters the Part_num (which is unique for all
records) and the software retrieves the fields *which* are mapped from
the database and loads them in the label. In case there are some other
fields which are not mapped to the database, the application does not
care about them. In other words, they are as good as blank.

Now, what I have in mind is to create a table such that all Database is
stored in it. Since
the application will load only those fields into the labels which are
mapped, it wouldnt create a problem.
Now if I have 100 records in table 1 and 10 records in table 2, the
table 3 should have 110 records at the end of operation. This table
alone will be accessed by the application to do its work.
My question is how to do this? I mean how can I take the records from
table 1, put them in table 3, then take the records from table 2 and
put them in table 3 , and so on?

Awaiting replies,
Regards,
Shwetabh

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация