473,385 Members | 1,919 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

SQL Create Dynamic Table View From Another Table

76
Problem:
I have a few related tables that collects information about a given publication. The information collected varies based on the type of collection and is stored in a few different tables. The latest requirement the customer wants is to alert the faculty when a publication is added that is 90% similar to another publication. To facilitate this I want to create a flat lookup table that I can easily query and manipulate.

The Database
Expand|Select|Wrap|Line Numbers
  1. ---------------
  2. PUBLICATIONS
  3. ---------------
  4. PublicationID (int)
  5. PublicationTypeID (int)
  6. AuthorList (varchar)
  7. Synopsis (varchar)
  8.  
  9. ------------------
  10. PUBLICATION_TYPE
  11. ------------------
  12. PublicationTypeID (int)
  13. PublicationTypeName (varchar)
  14.  
  15. ----------------------
  16. PUBLICATION_TYPE_FIELD
  17. ----------------------
  18. FieldID (int)
  19. PublicationTypeID (int)
  20. FieldType (varchar) 
  21. FieldName (varchar)
  22. Required (bit)
  23.  
  24. ------------------------
  25. PUBLICATION_INFORMATION
  26. ------------------------
  27. PublicationID (int)
  28. FieldID (int)
  29. FieldValue (varchar)
  30.  
The Question
Is it plausible or even reasonable to create a flat table view that would allow all the information be available in a single table?

IE:
==================================================
PublicationID | PublicationType | Field Name | Field Name | Field Name |
---------------------------------------------------------
1 | Book | Value | Value | Value |

Where the additional columns in the table are dynamically created by the available field type possibilities in another table?

Or have I lost my marbles and need to try a different approach?
Mar 3 '11 #1
1 2507
ck9663
2,878 Expert 2GB
Yes it's plausible. Though I would limit it to the columns you need. Creating a a view on the fly could mean additional rights given to the one executing your query.

Good Luck!!!

~~ CK
Mar 5 '11 #2

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

Similar topics

9
by: Deja User | last post by:
This is probably very simple but I can't figure out a way to update one table from another table. Here is an example: ------ TABLEA ------ first_name last_name
1
by: Mike9900 | last post by:
What is the best way to copy DataRow from one table to another table, without copying its structure, which means copying only its data. -- Mike
1
by: thengfen | last post by:
Hi! Im having a problem in transfering a set of records from a table to another table. The scenario is when i select combo box (Course taken such as diploma in IT), then the process will...
1
by: satishkhachane | last post by:
-------------------------------------------------------------------------------- I want to select one or more columns from one typed datatable and add it to another table . how I can do this ? ...
1
by: lcourchesne | last post by:
Hi there, This is what I am trying to do: Create a query that will insert a column from Table 2 into Table 1. These two tables are exactly the same in structure, however, there is no unique...
1
by: Sakakini | last post by:
How can I append last entry from one table to another table???
4
by: xoozlez | last post by:
Hi there, How do I insert new records from a dbo table to another table? This is what I have: 1 dbo_company 1 Member (table) I made a query in dbo_company with the criteria I only want to...
2
by: tomash | last post by:
Hi! I ve got two tables in Access 2007. I want to update a field of DataTable from another table, DataSumTable when two of their fields equals. ( the fields : Name and Period) I tried this...
3
by: anil2083 | last post by:
How to migrate the comma separated values from one table to another table? suppose we have table i.e XYZ and we have comma separated values in few columns i.e( column_name and values are...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...

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.