473,666 Members | 2,294 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

SQL Create Dynamic Table View From Another Table

76 New Member
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 2559
ck9663
2,878 Recognized Expert Specialist
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
19603
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
31131
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
1727
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 automatically save the list of subjects that need to be taken by students into student course info table.. i hv link all the related table together... I had tried a few solution but still cant... Hope somebody can help.... Thanks a lot! :)
1
2242
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 ? Eg :- table master it has column masterid , mastername now i select masterid and assign it to new comlunm.
1
4301
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 identifier in either table. For example, Table 1 has fields called Broker Number, Category, and Total Amount, and Table 2 also has fields called Broker Number, Category, and Total Amount. Broker Number and Category are identical in both tables,...
1
1989
by: Sakakini | last post by:
How can I append last entry from one table to another table???
4
4844
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 retrieve out new records from "ceo_email" and "contact_email" column after e.g 25.July.07
2
2235
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 sql code: UPDATE DataTable
3
2590
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 A,B,C,D).Now i have to migrate these comma separated values into new table i.e PQR. Example: Table1 column_name1 complexion values : VF,F,AVG etc.. column_name2 profession values : TEA,LECT etc...
0
8443
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8866
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8781
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8550
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8639
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6192
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4198
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4366
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2769
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.