|
Posted by Erland Sommarskog on 09/21/06 22:18
Matik (marzec@sauron.xo.pl) writes:
> Now here is the issue:
> table t_conf contain data, which can be modified by user. The user is
> seting the appropriate values.
> Now, there should be a view, which returns:
> - as headers (collumn names) this what is defined in description column
> of t_conf (for example: value_1, value_2 ... value_6)
> - as values, substrings of all data from t_data, cutted with start and
> length values for appropriate decription from t_conf.
> - first two columns of view, should be column val and fill of t_dataVal
> table
A view, just like a table, has a fixed number of columns, so it can't
be dynamic. Theoretically, you could have a trigger on the configuration
table that recreates the view each time some adds or removes a value.
I'm not really sure that I like this alternative a lot.
Overall, the entire design seems unsound to me. What would the point be
to store all data in a single column, and then use another table to
specify where the value boundaries are. I could guess that this is an
import table, but even in that case I would question if the field
definition should be apply before the data makes it to SQL Server.
--
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
Navigation:
[Reply to this message]
|