Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Simulating multiple tables
Message
De
08/07/2009 09:31:17
 
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Conception bases de données
Versions des environnements
SQL Server:
SQL Server 2005
Divers
Thread ID:
01410856
Message ID:
01410866
Vues:
27
>Do you want to have a trigger firing when a new column is added?
Yes
In SQL Server 2005 you need to look at DDL triggers.
Why?

Viv


>
>>Hi,
>>
>>We have an old VFP application which allowed users to design their own tables (worked fine but a bit clunky under the hood).
>>Now, moving to SQLServer I'm thinking of simulating multiple tables using a structure like this:
>>
>>ProductFiles Table
>>Id
>>
>>ProductFileColumns
>>Id
>>ProductFileId --> ProductFiles.Id
>>
>>ProductFileRows
>>Id
>>ProductFileId --> ProductFiles.Id
>>
>>ProductFileData
>>Id
>>ProductFileColumnId -->ProductFileColumns.Id
>>ProductFileRowId -->ProductFileRows.Id
>>Data......
>>
>>This works fine using triggers to add the neccessary records to ProductFileData whenever a row or column is added to a specific ProductFile. However I think I can do this without a ProductFileRows table.
>>Adding a row using a SPROC with the ProductFile.Id as a parameter is simple.
>>However I'm not sure of the best way to code a trigger for when a column is added to ProductFileColumns.
>>Any help?,
>>TIA
>>Viv
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform